Difference between revisions of "Template:Code"

From Beasts of Bermuda
Jump to: navigation, search
(Added Page)
 
m (Added functionality.)
 
Line 1: Line 1:
<includeonly><code>{{{1}}}</code></includeonly><noinclude>{{documentation|content=
+
<noinclude>
{{shortcut|c}}
 
 
Render text in a monospaced font suitable for code.
 
Render text in a monospaced font suitable for code.
 
This is simply a shorthand for {{c|<nowiki><code>fooobar</code></nowiki>}} which is annoying to type out every time; it's marginally nicer to write {{c|<nowiki>{{c|foobar}}</nowiki>}}.
 
  
 
== Usage ==
 
== Usage ==
This should be used to format technical strings such as UUIDs, file paths, snippets of code, etc. It {{em|should not}} be used as a general purpose formatting tool to separate some text from normal text.
+
This should be used to format technical strings such as UUIDs,  
 +
file paths, snippets of code, etc.  
 +
It <i> should </i> not be used as a general purpose formatting tool  
 +
to separate some text from normal text.
  
 
== Examples ==
 
== Examples ==
{{Template demo
+
With Template: <br>
| <nowiki>{{code|Scripts/thoth/helpers/CommonConditions.khn}}</nowiki>
+
{{Code | <nowiki> {{ImageText | Nesting_MAINPAGE.png | Nesting | w = 80 | h = 80 | font size = 80% }} </nowiki>}}<br>
| <nowiki>{{c|MAG_TheDueller_Rapier}}</nowiki>
+
 
| <nowiki>{{c|d49bf05e-4f94-4860-bd8c-ae63dae811be}}</nowiki>
+
Without Template: <br>
}}
+
<nowiki>{{ImageText | Nesting_MAINPAGE.png | Nesting | w = 80 | h = 80 | font size = 80% }}</nowiki>
  
== Template data ==
 
<templatedata>
 
{
 
"params": {
 
"1": {
 
"label": "Text",
 
"description": "Text to display as code",
 
            "type": "string",
 
"required": true
 
}
 
    },
 
    "description": "Render text in a monospace font suitable for code.",
 
    "format": "inline"
 
}
 
</templatedata>}}
 
 
[[Category: Templates]]
 
[[Category: Templates]]
[[Category: Formatting templates]]
+
 
 
</noinclude>
 
</noinclude>
 +
 +
<includeonly>
 +
    <code>
 +
        {{{1}}}
 +
    </code>
 +
</includeonly>

Latest revision as of 15:48, 23 November 2024

Render text in a monospaced font suitable for code.

Usage

This should be used to format technical strings such as UUIDs, file paths, snippets of code, etc. It should not be used as a general purpose formatting tool to separate some text from normal text.

Examples

With Template:


   
          {{ImageText | Nesting_MAINPAGE.png | Nesting | w = 80 | h = 80 | font size = 80% }} 
   


Without Template:
{{ImageText | Nesting_MAINPAGE.png | Nesting | w = 80 | h = 80 | font size = 80% }}