Template:Mono/doc
| This is a documentation subpage for Template:Mono It contains usage information, categories and other content that is not part of the original template page. |
| This template is used on many pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
| This template uses TemplateStyles: |
| Dis template no suppose be used inside citation templates like Citation Style 1 and Citation Style 2, because e get markup wey go spoil the COinS metadata wey dem create; see Wikipedia:COinS. |
How to use am
[edit source]{{mono|text to format here}}
e go render like:
text to format here
Dis template dey help format small parts of content (di only parameter) as monospaced (text wey all characters get equal width). E just be quick shortcut for di needed CSS code. E replace <tt>...</tt>, wey be old element under HTML5. (Features wey no conform)
Dis template should dey used when di content dey show as monospaced text only for style/display reason, and di display no get special meaning.
E should not dey used to show information wey get these meanings:
- source code, use {{code}} or
<code>...</code>instead - variables or variable input, use {{var}} or
<var>...</var>instead - keyboard input, use {{kbd}} or
<kbd>...</kbd>instead - sample output, use {{samp}} or
<samp>...</samp>instead
E no fit mark multiple paragraphs, sections, or other block elements, because e dey use <span>, and span be inline element. Use {{monodiv}} and {{pre}} for many blocks of text, or use different {{Mono}} for each separate line.
When di content end with one closing curly brace (}), di content for follow with <nowiki/>. Example: to format {foo}, use {{mono|{foo}<nowiki/>}} or {{mono|<nowiki>{foo}</nowiki>}}.
If di content get pipe characters (|) wey no dey inside <nowiki>...</nowiki>, you for escape dem with | or {{!}}.
Dis template no for dey used inside links because e fit affect later transclusions.
Parameters
[edit source]Dis template get two parameters:
|1=or unnamed- Di content wey go format as monospaced. If di content get
=character, di parameter for get number, otherwise di template go break. (You no need number di parameter if di=character dey inside<nowiki>...</nowiki>, or if you escape am as=.) Because of old template compatibility, dis parameter fit also be called|2=.
|needs_review=yes- Dem dey use am (for example by bots or AWB scripts) to show replacement of old
<tt>...</tt>markup with{{mono|...}}markup. Dis template no dey display anything and currently e no dey add categories, but cleanup category fit be created if needed. E show say di markup fit need change to something wey get better meaning, like<code>...</code>,<samp>...</samp>, or<kbd>...</kbd>.
TemplateData
[edit source]See also
[edit source]- {{pre}}
- {{var}}
- {{code}}, wey only provide syntax highlighting and no stop line breaks
- {{Codett}}, wrapper for dis template wey remove background and border style
- {{PreCode}}, wey stop line breaks inside code
- {{param value}}, monospaced and friendly with blank space
- {{Syntaxhighlight}}
- {{kbd}}, for keyboard input