Template:Samp: Difference between revisions

From OpenMW Wiki
Jump to navigation Jump to search
(creating template)
 
m (ce)
 
Line 10: Line 10:
* Directory/folder paths, filenames, and filename extensions (in running text, i.e. as partial output of a directory listing). This is helpful in running text because it distinguishes operating-system stuff from plain-English material, such as the published title of a mod as distinct from a particular <samp>.esp</samp> or other resource included in it.
* Directory/folder paths, filenames, and filename extensions (in running text, i.e. as partial output of a directory listing). This is helpful in running text because it distinguishes operating-system stuff from plain-English material, such as the published title of a mod as distinct from a particular <samp>.esp</samp> or other resource included in it.


It is best to consistently use this template or its underlying element for things like directories, files, extensions, and IDs, and not overload the use of the <code><nowiki><code>...</code></nowiki></code> element, because that element on many wikis (including this one) is given a background color and a border, and this can be distracting in running text, especially when used for a single short string.  In code, it also doesn't make sense to nest two <code><nowiki><code>...</code></nowiki></code> elements, but it often does make sense to mark output as such within blocks of "code" in a lose sense of that word.
It is best to consistently use this template or its underlying element for things like directories, files, extensions, and IDs, rather than overload the use of the <code><nowiki><code>...</code></nowiki></code> element, because that element on many wikis (including this one) is given a background color and a border, and this can be distracting in running text, especially when used for a single short string.  In code, it also doesn't make sense to nest two <code><nowiki><code>...</code></nowiki></code> elements, but it often does make sense to mark output as such within blocks of "code" in a lose sense of that word.


'''Usage:'''
'''Usage:'''

Latest revision as of 16:10, 15 August 2017

output

Documentation

This is a convenient template wrapper for the <samp>...</samp> HTML element, the proper markup for output, broadly defined. It is rendered in monospace by most browsers. This can be used in running text or inside <code>...</code>.

It is usually used for:

  • Output messages from executables (in running text or in code examples). This is helpful in code to distinguish between code per se and what code produces. It is helpful in running text to make it clear we're talking about such output and not something in-game.
  • Game object IDs and coordinates (in running text, i.e. as output of Console, script, or CS lookups). This is helpful in running text because it distinguishes IDs from plain-English material, such as the non-ID names for things in the game.
  • Directory/folder paths, filenames, and filename extensions (in running text, i.e. as partial output of a directory listing). This is helpful in running text because it distinguishes operating-system stuff from plain-English material, such as the published title of a mod as distinct from a particular .esp or other resource included in it.

It is best to consistently use this template or its underlying element for things like directories, files, extensions, and IDs, rather than overload the use of the <code>...</code> element, because that element on many wikis (including this one) is given a background color and a border, and this can be distracting in running text, especially when used for a single short string. In code, it also doesn't make sense to nest two <code>...</code> elements, but it often does make sense to mark output as such within blocks of "code" in a lose sense of that word.

Usage:

{{samp|the output here}}

If the content contains a = character, the parameter must be named (as |1=), but this is unlikely to arise.

For user input, see {{kbd}}.

These templates should not be used as a way to just get monospaced font for some other purpose; use <span style="font-family: monospace;">...</span>.