FANDOM


This template is used to create lines formatted as code. It has up to 19 parameters, depending on its usage. The version of this template that you use depends on what is entered in the first parameter.

Basic Formatting

For simply creating a line formatted as code, any value (except L or T) is entered in the first parameter:

  • {{Code|your text here}} becomes your text here
    • If you need to present a single character in code font, please use <code>...</code> instead.

Link Formatting

To format an active link as code, the previous example works:

But to format the link as code without markup, it must be entered differently:

  • {{Code||L|This is a link}} becomes [[This is a link]]

Note that the first parameter is now L

Template Example Formatting

Formatting a line as a template example, such as these lines here, requires more parameters:

  • {{Code|T|Template|Color|Modifier|Parameter1|Parameter2||Parameter14|Parameter15}}
  • T: The T here forces template formatting. This value should not be changed
  • Template: The name of the template being presented
  • Color: The color of the text to be displayed. This can be entered as the name of the color (for common colors only), or as a hex color value preceded by a #. Wikipedia has a listing of all permitted names, and how to "create" your own colors.
  • Modifier: Enter 1 here to display the less-than and greater-than symbols around the parameter names
  • Parameter1Parameter15: The parameters of your template

{{Code|T|My template|green|1|These|are|my|parameters|in|green|with|brackets}}

produces

{{My template|<These>|<are>|<my>|<parameters>|<in>|<green>|<with>|<brackets>}}


{{Code|T|My template|lightsalmon|Now|it's|in|light|salmon|without|brackets}}

produces

{{My template|Now|it's|in|light|salmon|without|brackets}}


Author's note: creating this documentation was quite confusing, especially at the "Template Example Formatting", because I'm using this template to explain how to use this template. So many self-references...but now it's SO much easier to format things as code!

Community content is available under CC-BY-SA unless otherwise noted.