Jump to content

Template:Semantic markup templates: Difference between revisions

From ARC Technical Repository
m 1 revision imported
More commonly used shortcut (tlc) for "template link code".
Line 20: Line 20:
   | {{tlb|em}}        | "An {{em|emphatic phrase}}"                          | To indicate [[HTML element#em|<nowiki><em></nowiki>]] stress emphasis (not just purely typographical italicization like for book titles or foreign terms)
   | {{tlb|em}}        | "An {{em|emphatic phrase}}"                          | To indicate [[HTML element#em|<nowiki><em></nowiki>]] stress emphasis (not just purely typographical italicization like for book titles or foreign terms)
   | {{tlb|var}}        | {{var|strPrefix}}                                    | To indicate text is a variable name. Use for any variable names except those including "I" (uppercase&nbsp;i) and/or "l" (lowercase&nbsp;L); for these, {{braces|var serif}} should be used to ensure a noticeable distinction
   | {{tlb|var}}        | {{var|strPrefix}}                                    | To indicate text is a variable name. Use for any variable names except those including "I" (uppercase&nbsp;i) and/or "l" (lowercase&nbsp;L); for these, {{braces|var serif}} should be used to ensure a noticeable distinction
   | {{tlb|var serif}}   | {{var serif|strIllustratePrefix}}                     | (see {{braces|var}} above)
   | {{tlb|var serif}} | {{var serif|strIllustratePrefix}}                   | (see {{braces|var}} above)
   | {{tlb|tld}}       | {{tld|DEFAULTSORT:Y, X}}                             | To display wikicode variables and [[Help:Magic words|magic words]] as they would appear in code
   | {{tlb|mvar}}      | Let {{mvar|x}} be the maximum value used.            | Used to refer to individual variables in &lt;math&gt; ([[MOS:FORMULA|formula]]) elements in normal running text.
  | {{tlb|dfn}}        | This {{dfn|term|Definition}} has a definition        | To indicate a [[MOS:TERM|term]] defined in nearby text.
  | {{tlb|dfni}}      | This {{dfni|term}} has a definition                  | Wrapper for {{tl|dfn}} that applies metadata and italic styling.
  | {{tlb|lang}}      | She said: "{{lang|fr|Je suis française.}}"          | Indicate that a piece of text belongs to a particular language other than that of the page as a whole.
  | {{tlb|tlc}}/{{tlb|tld}} | {{tld|DEFAULTSORT:Y, X}}                       | To display wikicode variables and [[Help:Magic words|magic words]] as they would appear in code
   | {{tlb|parameter}}  | {{para|year|2008}}                                  | To display template parameters with or without values
   | {{tlb|parameter}}  | {{para|year|2008}}                                  | To display template parameters with or without values
   | {{tlb|param}}      | {{param|title|alt}}                                  | To display parameters as used in code (i.e. with triple braces), especially to indicate relationships between them. May be combined with {{braces|parameter}} above
   | {{tlb|param}}      | {{param|title|alt}}                                  | To display parameters as used in code (i.e. with triple braces), especially to indicate relationships between them. May be combined with {{braces|parameter}} above
Line 27: Line 31:
   | {{tlb|tlx}} etc.  | {{tlx|Template|{{var|1}}|{{var|2}}|...|{{var|10}}}}  | To display a template call (with or without parameters and values) as code
   | {{tlb|tlx}} etc.  | {{tlx|Template|{{var|1}}|{{var|2}}|...|{{var|10}}}}  | To display a template call (with or without parameters and values) as code
   | {{tlb|tag}}        | {{resize|95%|"The {{tag|img}} tags&thinsp;..."}}    | To render [[HTML element]]s ("tags") in prose
   | {{tlb|tag}}        | {{resize|95%|"The {{tag|img}} tags&thinsp;..."}}    | To render [[HTML element]]s ("tags") in prose
   | {{tlb|code}}/{{tlb|codett}} | {{resize|95%|"Ensure the {{code|1=alt=}} parameter&thinsp;..."}} | To indicate text is source code. To nest other templates within {{braces|code}}, use {{tag|code}}. {{tl|codett}} differs only in styling: {{code|someMethod}} becomes  {{codett|someMethod}}
   | {{tlb|code}}/{{tlb|codett}} | "Ensure the {{code|1=alt=}} parameter&thinsp;..."  | To indicate text is source code. To nest other templates within {{braces|code}}, use {{tag|code}}. {{tl|codett}} differs only in styling: {{code|someMethod}} becomes  {{codett|someMethod}}
   | {{tlb|PreCode}} | {{resize|95%|"[[Forth (programming language)|FORTH]] has keyword {{PreCode|?BRANCH}}."}} | Like {{tlb|code}}, but prevents line breaks inside the code. Only for very short code parts.
   | {{tlb|PreCode}} | {{resize|95%|"[[Forth (programming language)|FORTH]] has keyword {{PreCode|?BRANCH}}."}} | Like {{tlb|code}}, but prevents line breaks inside the code. Only for very short code parts.
   | {{tlg|bold=y|subst=y|codenowiki}} | <code><nowiki>{{small|small text example}}</nowiki></code>  | To wrap example code in {{code|<code><<nowiki>nowiki</nowiki>>...<<nowiki>/nowiki</nowiki>></code>}}
   | {{tlg|bold=y|subst=y|codenowiki}} | <code><nowiki>{{small|small text example}}</nowiki></code>  | To wrap example code in {{code|<code><<nowiki>nowiki</nowiki>>...<<nowiki>/nowiki</nowiki>></code>}}
   | {{tlg|bold=y|subst=y|kbdnowiki}}  | <kbd><nowiki>{{large|large text example}}</nowiki></kbd>        | To wrap example code in {{code|<kbd><<nowiki>nowiki</nowiki>>...<<nowiki>/nowiki</nowiki>></kbd>}}
   | {{tlg|bold=y|subst=y|kbdnowiki}}  | <kbd><nowiki>{{large|large text example}}</nowiki></kbd>        | To wrap example code in {{code|<kbd><<nowiki>nowiki</nowiki>>...<<nowiki>/nowiki</nowiki>></kbd>}}
 
   | {{tlb|syntaxhighlight}}      | {{syntaxhighlight|border=no|lang=html|line=1|highlight=2|code=
   | {{tlb|syntaxhighlight}}      | &nbsp; &nbsp; <sub>[this is a block template]</sub> | ({{thin space|or {{tlx|sxhl}}}})&nbsp; Wrapper for {{tag|syntaxhighlight}}, but will wrap overflowing text
<table align=center style="background: ivory">}} | ({{thin space|or {{tlx|sxhl}}}})&nbsp; Wrapper for {{tag|syntaxhighlight}}, but will wrap overflowing text
   | {{tlb|deprecated code}}      | "Do not use {{tag|{{deprecated code|blink}}|o}}."  | ({{thin space|or {{tlx|dc}}}})&nbsp; To indicate [[Deprecation|deprecated]] source code in template documentation, articles on HTML specs, etc. The {{tlx|dc2}} variant uses strike-through ({{tag|{{dc2|blink}}|o}}) while {{tlx|dcr}} uses red ({{tag|{{dcr|blink}}|o}}).
   | {{tlb|deprecated code}}      | "Do not use {{tag|{{deprecated code|blink}}|o}}."  | ({{thin space|or {{tlx|dc}}}})&nbsp; To indicate [[deprecated]] source code in template documentation, articles on HTML specs, etc. The {{tlx|dc2}} variant uses strike-through ({{tag|{{dc2|blink}}|o}}) while {{tlx|dcr}} uses red ({{tag|{{dcr|blink}}|o}}).
   | {{tlb|pre}}                  | &nbsp; &nbsp; <sub>[this is a block template]</sub> | For larger blocks of source code and other pre-formatted text
   | {{tlb|pre}}                  | {{pre|You miss '''100%''' of the shots you don't take}}  | For larger blocks of source code and other pre-formatted text
   | {{tlb|quote}}                | &nbsp; &nbsp; <sub>[this is a block template]</sub> | For block quotations (only – never for non-quotations)
   | {{tlb|blockquote}}                | {{blockquote|No good deed<br />goes unpunished}}| For block quotations (only – never for non-quotations)
   | {{tlb|block indent}}          | &nbsp; &nbsp; <sub>[this is a block template]</sub> | For indented blocks of material; visually identical to {{tlx|quote}} but without quote markup
   | {{tlb|block indent}}          | {{block indent|Hurry and succumb<br />to temptation before it<br />goes away}} | For indented blocks of material; visually identical to {{tlx|quote}} but without quote markup
   | {{tlb|kbd}}                  | {{kbd|user input}}                                  | To indicate user input
   | {{tlb|kbd}}                  | {{kbd|user input}}                                  | To indicate user input
   | {{tlb|key press}}            | {{key press|Ctrl|x}}                                | To indicate specific-keystroke input, including combinations
   | {{tlb|key press}}            | {{key press|Ctrl|x}}                                | To indicate specific-keystroke input, including combinations

Revision as of 05:52, 23 September 2026