Template:Code

From Structorica Wiki
Revision as of 19:57, 15 January 2026 by Ivan (talk | contribs) (Created page with "<includeonly>{{#if: {{{2|}}}{{{wordbreak|{{{wb|}}}}}} | {{#invoke:DelimitedTag|output|1={{{1|{{{code|}}}}}}|tag=code|wordbreak={{{wordbreak|{{{wb|}}}}}}}} | <code>{{{1|{{{code|}}}}}}</code> }}</includeonly><noinclude> === Documentation === This template provides an alternative to HTML <code><code></code> elements. Useful for displaying multiple code snippets with custom delimiters. == Parameters == * '''Anonymous parameters''' - code text to display * '''d/delimi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Documentation

This template provides an alternative to HTML <code> elements. Useful for displaying multiple code snippets with custom delimiters.

Parameters

  • Anonymous parameters - code text to display
  • d/delimiter - separator between items (default: space, can be "and", "or", ",", etc.)
  • wb/wordbreak - allow breaking long text (useful for URLs)


Examples

  1. {{code|text}}text
  2. {{code|1|2|3|4|5}}1 2 3 4 5
  3. Formatted code
    1. {{code|''fancy text''}}fancy text
    2. {{code|'''emphasized text'''}}emphasized text
    3. {{code|link to [[Structorica]]}}link to Structorica
    4. {{code|[https://imgur.com/]}}[1]
  4. Comma delimiter
    1. {{code|1|2|3|4|5|d=,}}1, 2, 3, 4, 5
    2. {{code|1|2|3|4|5|delim=,}}1, 2, 3, 4, 5
    3. {{code|1|2|3|4|5|delimiter=,}}1, 2, 3, 4, 5
  5. And delimiter
    1. {{code|1|2|3|4|5|d=and}}1, 2, 3, 4, and 5
    2. {{code|1|2|3|4|5|delim=and}}1, 2, 3, 4, and 5
    3. {{code|1|2|3|4|5|delimiter=and}}1, 2, 3, 4, and 5
  6. Or delimiter
    1. {{code|1|2|3|4|5|d=or}}1, 2, 3, 4, or 5
    2. {{code|1|2|3|4|5|delim=or}}1, 2, 3, 4, or 5
    3. {{code|1|2|3|4|5|delimiter=or}}1, 2, 3, 4, or 5
  7. Escape character usage
    1. {{code|<nowiki>something=one|two|three</nowiki>}}something=one|two|three
    2. {{code|something{{=}}one{{!}}two{{!}}three}}something=one|two|three
    3. {{code|<nowiki> </nowiki>}} – 
    4. {{code|&nbsp;}} 


Source

This template is a fork of Minecraft Wiki's Code template.