Misplaced Pages

Template:Mono: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Browse history interactively← Previous editNext edit →Content deleted Content addedVisualWikitext
Revision as of 22:22, 31 August 2008 view sourceSMcCandlish (talk | contribs)Autopatrolled, Extended confirmed users, Page movers, File movers, New page reviewers, Pending changes reviewers, Rollbackers, Template editors201,744 edits Usurping redirect for useful template.← Previous edit Revision as of 00:16, 18 June 2010 view source GPHemsley (talk | contribs)Extended confirmed users, Template editors5,220 edits Up font size.Next edit →
Line 1: Line 1:
<span style="font-family: monospace;">{{{1}}}</span><noinclude> <span style="font-family: monospace; font-size: 1.2em;">{{{1}}}</span><noinclude>
{{Documentation}} {{Documentation}}
<!--Categories and interwikis go on the /doc subpage. <!--Categories and interwikis go on the /doc subpage.

Revision as of 00:16, 18 June 2010

{{{1}}}

Template documentation[view] [edit] [history] [purge] RedirectShortcuts
WarningThis template is used on approximately 31,000 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.
CSSThis template uses TemplateStyles:
This template should not be used in citation templates such as Citation Style 1 and Citation Style 2, because it includes markup that will pollute the COinS metadata they produce; see Misplaced Pages:COinS.

Usage

{{mono|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 <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.

It should not be used to indicate information with these semantics:

  • 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

It cannot be used to mark up multiple paragraphs, sections or other block elements, as it uses <span>, which is an inline element. Use {{monodiv}} and {{pre}} for multiple blocks of text, or use multiple instances of {{Mono}} for each individual line.

When the content ends with a single closing curly brace (}), the content should be followed by <nowiki/>, for example, to mark up {foo}, use {{mono|{foo}<nowiki/>}} or {{mono|<nowiki>{foo}</nowiki>}}.

If the content contains pipe characters (|) not surrounded by <nowiki>...</nowiki>, they must be escaped with &#124; or {{!}}.

This template should not be used in links as it can affect later transclusions.

Parameters

There are two parameters:

|1= or unnamed
The content to format as monospaced. If the content contains a = character, the parameter must be numbered or the template will break. (The parameter does not need to be numbered if the = character is surrounded by <nowiki>...</nowiki>, or if it is escaped as &#61;.) For backward compatibility with an old, merged-in template, this parameter can also be called |2=.
|needs_review=yes
Used (e.g. by bots or AWB scripts) to indicate replacement of now-obsolete <tt>...</tt> markup with {{mono|...}} markup. This template displays nothing and presently does no categorization, though a cleanup category can be created if necessary. It indicates that the markup may need to be changed to something more semantically meaningful, such as <code>...</code>, <samp>...</samp>, or <kbd>...</kbd>.

TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Mono in articles based on its TemplateData.

TemplateData for Mono

This template is for formatting short bits of content as monospaced text.
ParameterDescriptionTypeStatus
Content1
2
The content to format as monospaced.Linerequired
Needs Review?needs_reviewUsed (e.g. by bots or AWB scripts) to indicate replacement of now-obsolete <tt>...</tt> markup with {{mono|...}} markup. This template displays nothing and presently does no categorization, though a cleanup category can be created if necessary. It indicates that the markup may need to be changed to something more semantically meaningful, such as <code>...</code>, <samp>...</samp>, or <kbd>...</kbd>.
Auto value
yes
Booleanoptional

Format: inline

See also

Semantic markup templates
Template  Example output  Use 
{{strong}} Important! To indicate <strong> importance, seriousness, or urgency instead of just simple typographical boldfacing
{{strongbad}} "Never use ..." Same as {{strong}} but in red
{{stronggood}} "Only use ..." Same as {{strong}} but in green
{{em}} "An emphatic phrase" To indicate <em> stress emphasis (not just purely typographical italicization like for book titles or foreign terms)
{{var}} strPrefix To indicate text is a variable name. Use for any variable names except those including "I" (uppercase i) and/or "l" (lowercase L); for these, {{var serif}} should be used to ensure a noticeable distinction
{{var serif}} strIllustratePrefix (see {{var}} above)
{{tld}} {{DEFAULTSORT:Y, X}} To display wikicode variables and magic words as they would appear in code
{{para}} |year=2008 To display template parameters with or without values
{{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 {{para}} above
{{tjp}} selfref=yes To display template parameters with colors (as they would appear in the {{tj}} and {{tji}} templates)
{{param value}} ··2·blanks·fore·and·aft·· To display parameter values lightly bordered; replaces <code>...</code>, especially when value contains embedded or leading/trailing blanks; visualized here with middot (·) but can use ␠, ▯, or any character.
{{tlx}} etc. {{Template|1|2|...|10}} To display a template call (with or without parameters and values) as code
{{tji}} {{hatnote|Hello|selfref=yes|category=no}} To showcase with colors in horizontal format the syntax of any template, while providing an easy way to display placeholder texts using colons as separators
{{tag}} "The <img>...</img> tags ..." To render HTML elements ("tags") in prose
{{code}}/{{codett}} "Ensure the alt= parameter ..." To indicate text is source code. To nest other templates within {{code}}, use <code>...</code>. {{codett}} differs only in styling: someMethod becomes someMethod
{{PreCode}} "FORTH has keyword ?BRANCH." Like {{code}}, but prevents line breaks inside the code. Only for very short code parts.
{{subst:codenowiki}} {{small|small text example}} To wrap example code in <code><nowiki>...</nowiki></code>
{{subst:kbdnowiki}} {{large|large text example}} To wrap example code in <kbd><nowiki>...</nowiki></kbd>
{{syntaxhighlight}}     ( or {{sxhl}} )  Wrapper for <syntaxhighlight>...</syntaxhighlight>, but will wrap overflowing text
{{deprecated code}} "Do not use <blink>." ( or {{dc}} )  To indicate deprecated source code in template documentation, articles on HTML specs, etc. The {{dc2}} variant uses strike-through (<blink>) while {{dcr}} uses red (<blink>).
{{pre}}     For larger blocks of source code and other pre-formatted text
{{tj}}     To showcase with colors and multiple lines (vertical format) the syntax of any template, while providing an easy way to display placeholder texts using colons as separators
{{quote}}     For block quotations (only – never for non-quotations)
{{block indent}}     For indented blocks of material; visually identical to {{quote}} but without quote markup
{{kbd}} user input To indicate user input
{{key press}} Ctrl+x To indicate specific-keystroke input, including combinations
{{key top}} Left shift Similar; includes more symbols, but does not directly support combinations
{{button}} Don't save To indicate a button in a user interface
{{samp}} example output To indicate sample or example output
The above documentation is transcluded from Template:Mono/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template. Category: