Template:Lessthan/doc: Difference between revisions
(Created page with "<noinclude>{{docsub}}</noinclude> '''''This template is for rendering a specific character "<", not for actually performing math operations.''' For that, you want ParserFunctions.'' This template can be used in place of a literal "<" when the latter would be interpreted as a syntactic marker. In particular, it can be used inside templates meant for subst:ing, together with the <code><nowiki><includeonly>subst:</includeonly></nowiki...") |
mNo edit summary |
||
Line 2: | Line 2: | ||
'''''This template is for rendering a specific character "<", not for actually performing math operations.''' For that, you want [[mw:Help:Extension:ParserFunctions|ParserFunctions]].'' | '''''This template is for rendering a specific character "<", not for actually performing math operations.''' For that, you want [[mw:Help:Extension:ParserFunctions|ParserFunctions]].'' | ||
This template can be used in place of a literal "<" when the latter would be interpreted as a syntactic marker. In particular, it can be used inside templates meant for subst:ing, together with the <code><nowiki><includeonly>subst:</includeonly></nowiki></code> trick, to allow the subst:ed output to contain HTML comments that contain other subst:ed templates, [[ | This template can be used in place of a literal "<" when the latter would be interpreted as a syntactic marker. In particular, it can be used inside templates meant for subst:ing, together with the <code><nowiki><includeonly>subst:</includeonly></nowiki></code> trick, to allow the subst:ed output to contain HTML comments that contain other subst:ed templates, [[mw:Help:Parser function|parser functions]] or [[mw:Help:Variable|variables]]. This works even under the [[mw:Migration to the new preprocessor|new parser]], which doesn't otherwise allow code within comments to be evaluated. | ||
For example, the code "<code><nowiki>{{<includeonly>subst:</includeonly>lessthan}}!-- {{<includeonly>subst:</includeonly>SITENAME}} --></nowiki></code>" in a template produces "<code><nowiki><!-- Wikipedia --></nowiki></code>" when subst:ed. | For example, the code "<code><nowiki>{{<includeonly>subst:</includeonly>lessthan}}!-- {{<includeonly>subst:</includeonly>SITENAME}} --></nowiki></code>" in a template produces "<code><nowiki><!-- Wikipedia --></nowiki></code>" when subst:ed. |
Latest revision as of 04:37, 21 December 2023
This is a documentation subpage for Template:Lessthan. It may contain usage information, categories and other content that is not part of the original template page. |
This template is for rendering a specific character "<", not for actually performing math operations. For that, you want ParserFunctions.
This template can be used in place of a literal "<" when the latter would be interpreted as a syntactic marker. In particular, it can be used inside templates meant for subst:ing, together with the <includeonly>subst:</includeonly>
trick, to allow the subst:ed output to contain HTML comments that contain other subst:ed templates, parser functions or variables. This works even under the new parser, which doesn't otherwise allow code within comments to be evaluated.
For example, the code "{{<includeonly>subst:</includeonly>lessthan}}!-- {{<includeonly>subst:</includeonly>SITENAME}} -->
" in a template produces "<!-- Wikipedia -->
" when subst:ed.