Template:Code/Doc

From Open Fortress Wiki
Revision as of 02:49, 4 January 2025 by Kate (talk | contribs) (Created page with "{{Doc/subpage}}__NOTOC__ This template will allow you to format text as a one-line code. == Parameters and Examples == {| class=standard-table | style="width:100%" |- ! Parameters ! {{int:listfiles_description}} ! {{int:apisandbox-examples}} ! {{int:preview}} |- | align=center | {{Code|{{Param|preset}}}} | Preset Template Styles. The following presets are available: :* {{Code|preset=0|Default}} – The default style is based on Markdown; :* {{Code|preset=1|0}} – Clear...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This template will allow you to format text as a one-line code.

Parameters and Examples

Parameters Description Examples Preview
{{{preset}}} Preset Template Styles. The following presets are available:
  • Default – The default style is based on Markdown;
  • 0 – Clear version;
  • 1 – Desaturated version;
  • 2 – Outlined version;
  • 3 – A brighter outlined version.
{{Code|Hello, World!}}
{{Code|preset=0|Hello, World!}}
{{Code|preset=1|Hello, World!}}
{{Code|preset=2|Hello, World!}}
{{Code|preset=3|Hello, World!}}
Hello, World!
Hello, World!
Hello, World!
Hello, World!
Hello, World!
{{{select}}} Text selection mode. Uses the user-select CSS property. Default value is unset.
{{Code|select=none|Hello, World!}}
{{Code|select=all|Hello, World!}}
Hello, World!
Hello, World!
{{{style}}} CSS styles.
{{Code|style=color:#EF9B9B|Hello, World!}}
Hello, World!
{{{highlight}}} Adds syntax highlighting for the language specified.
Bug:Condenses code into one line.  [todo tested in?]
{{Code|highlight=c|int main() {return 0;} }}
<syntaxhighlight lang="c" inline="1" style="background-color:transparent;">int main() {return 0;} </syntaxhighlight>