Template:Code: Difference between revisions
Jump to navigation
Jump to search
m (Taylan moved page Template:C to Template:Code) |
(Updated documentation) |
||
Line 1: | Line 1: | ||
<includeonly><code>{{{1}}}</code></includeonly><noinclude>This is simply a shorthand for <nowiki><code>fooobar</code></nowiki> which is annoying to type out every time; it's marginally nicer to write <nowiki>{{ | <includeonly><code>{{{1}}}</code></includeonly><noinclude>{{documentation|content= | ||
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 == | |||
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. | |||
== Examples == | |||
{{Template demo | |||
| <nowiki>{{code|Scripts/thoth/helpers/CommonConditions.khn}}</nowiki> | |||
| <nowiki>{{c|MAG_TheDueller_Rapier}}</nowiki> | |||
| <nowiki>{{c|d49bf05e-4f94-4860-bd8c-ae63dae811be}}</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: Formatting templates]] | |||
</noinclude> |
Revision as of 08:08, 22 November 2024
Template documentation
Render text in a monospaced font suitable for code.
This is simply a shorthand for <code>fooobar</code>
which is annoying to type out every time; it's marginally nicer to write {{c|foobar}}
.
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
Markup | Renders as |
---|---|
{{code|Scripts/thoth/helpers/CommonConditions.khn}} | Scripts/thoth/helpers/CommonConditions.khn |
{{c|MAG_TheDueller_Rapier}} | MAG_TheDueller_Rapier |
{{c|d49bf05e-4f94-4860-bd8c-ae63dae811be}} | d49bf05e-4f94-4860-bd8c-ae63dae811be |
Template data
Render text in a monospace font suitable for code.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Text | 1 | Text to display as code | String | required |