Template:Tt/doc: Difference between revisions
(+TR) |
(→Parameter: Use TemplateData) |
||
Line 2: | Line 2: | ||
== Usage == |
== Usage == |
||
{{ |
{{tlx|tt|<var>text to format here</var>}} |
||
renders as: |
renders as: |
||
Line 25: | Line 25: | ||
=== Parameter === |
=== Parameter === |
||
<templatedata> |
|||
;{{{1}}} or unnamed |
|||
{ |
|||
: The content to format as monospaced. If the content contains a <code>=</code> character, <code>{{tl|{{=}}}}</code> must be used instead. |
|||
"description": "This template is for formatting short bits of content as monospaced (nonproportional) text.", |
|||
"format": "inline", |
|||
"params": { |
|||
"1": { |
|||
"label": "Content", |
|||
"description": "The content to format as monospaced.", |
|||
"required": true, |
|||
"type": "content" |
|||
} |
|||
} |
|||
} |
|||
</templatedata> |
|||
Note: Copied from [[wikipedia:Template:Mono]], renamed to 'tt' because it replaces the tt tag.<br/> |
Note: Copied from [[wikipedia:Template:Mono]], renamed to 'tt' because it replaces the tt tag.<br/> |
||
"monospace, monospace" needed per [[wikipedia: |
"monospace, monospace" needed per [[wikipedia:WP:MONO|WP:MONO]] |
||
<noinclude> |
<noinclude> |
Revision as of 21:41, 17 May 2021
Usage
{{tt|text to format here}}
renders as:
text to format here
This template is for formatting short bits of content (the only parameter) as monospaced (nonproportional) text. It is simply a quick shorthand for the necessary CSS code. It is a replacement for Template:Tag, which is an obsolete element under HTML5. (Non-conforming features)
This template should be used where the content is being rendered in monospaced text for purely stylistic/display reasons, where this display has no particular semantic significance.
It cannot be used to mark up multiple paragraphs, sections or other block elements, as it uses Template:Tag, which is an inline element.
Template:Tag is normally used to indicate source code and Template:Tag for variables or variable input.
Template:Tag and Template:Tag display similarly to Template:Tag, and are normally used for keyboard and samples.
For example:
- {{tt|123<br/>ABC}}
produces
- 123
ABC
rather than
- 123
ABC
Parameter
<templatedata> { "description": "This template is for formatting short bits of content as monospaced (nonproportional) text.", "format": "inline", "params": { "1": { "label": "Content", "description": "The content to format as monospaced.", "required": true, "type": "content" } } } </templatedata>
Note: Copied from wikipedia:Template:Mono, renamed to 'tt' because it replaces the tt tag.
"monospace, monospace" needed per WP:MONO