Template:Monodiv: Difference between revisions
More actions
Created page with "{{<includeonly>safesubst:</includeonly>ifsubst|1=|2=<templatestyles src="Mono/styles.css" />}}<div class="monospaced"> {{{2|{{{1}}}}}}</div><noinclude> {{Documentation}} <!-- Categories go on the /doc subpage and interwikis go on Wikidata. --> </noinclude>" |
No edit summary |
||
| Line 1: | Line 1: | ||
{{<includeonly>safesubst:</includeonly>ifsubst|1=|2=<templatestyles src="Mono/styles.css" />}}<div class="monospaced"> | {{<includeonly>safesubst:</includeonly>ifsubst|1=|2=<templatestyles src="Template:Mono/styles.css" />}}<div class="monospaced"> | ||
{{{2|{{{1}}}}}}</div><noinclude> | {{{2|{{{1}}}}}}</div><noinclude> | ||
{{Documentation}} | {{Documentation}} | ||
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. --> | <!-- Categories go on the /doc subpage and interwikis go on Wikidata. --> | ||
</noinclude> | </noinclude> | ||
Latest revision as of 00:38, 16 March 2025
| This template uses TemplateStyles: |
Usage
{{monodiv|
text line 1
text line 2
text line 3}}renders as:
text line 1
text line 2
text line 3This template is for formatting multi-line sections of content as plain, monospaced (nonproportional) text. It is a quick shorthand for the necessary CSS code. It is the multi-line version of {{mono}} and a replacement for <tt>...</tt>, 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. Because it uses <div>...</div> tags for formatting instead of <span>...</span> tags, it can be used to wrap bulleted lists, along with div-based list templates like {{hlist}}.
It should not be used to indicate source code, nor for variables or variable input (use {{code}} or <code>...</code> for code and {{var}} or <var>...</var> for variables). For keyboard or samples, use <kbd>...</kbd> or <samp>...</samp> respectively.
When the content ends with a single closing curly brace (}), the content should be followed by <nowiki/>, for example, to mark up {foo}, use {{monodiv|{foo}<nowiki/>}} or {{monodiv|<nowiki>{foo}</nowiki>}}.
If the content contains pipe characters (|) not surrounded by <nowiki>...</nowiki>, they must be escaped with | or {{!}}.
Parameters
There is only one parameter:
|1=or unnamed- The content to format as monospaced. If the content contains a
=character, the parameter must be numbered with|1=.