Template:Markup/doc

This template is used to present markup or code side by side with the output it renders.

Usage
Each pair of Markup's arguments should be two copies of some wikitext markup, with the first of the pair enclosed in nowiki tags. The template produces output in two columns, the first showing the markup and the second showing how it is rendered. The template accepts up to 40 unnamed parameters, resulting in up to 20 rows of examples.

This:

Produces this:

In many cases, the markup for both columns are identical, but there are instances where this may need to differ. If none of these issues apply, then you may use to save yourself from copying the code twice.
 * Header markup such as == will show in the page table of contents; to avoid this, use in the markup for the second column (see example below).
 * Some templates will place the page in a maintenance category, which is usually undesired. For example.
 * Instead of, use in the second column.
 * Some templates may have error checking that places the page in a maintenance category.
 * templates with errors: add true to the template in the second column.
 * To avoid this and the associated red error messages make sure that each example on the page uses different sources.
 * HTML entities are parsed in the first cell, even with nowiki tags. To work around this, replace the  with   in the first column (see example below).

It is advisable to begin both copies of the markup with a newline; this is necessary if the first line of the markup must start on a new line (such as #, * or ;).

A complex example
In this example, Markup's second argument here uses fake heading (to avoid headings appearing in the table of contents) and fake citation needed (to avoid adding this page to the maintenance list).

{{Markup
 * The quick brown fox jumps over the lazy dog.{{#tag:ref|A footnote. |group=nb}} The cow jumped over the moon.{{fact}}

With HTML entities
HTML entities are parsed in the markup cell. To work around this, replace the  with   in the first column.

renders as:

With the glyphs "|" and "="
If the markup contains the glyphs  or   they need to be replaced by the magic words   or. If not they are being interpreted for the Template:Markup itself as a separator between the parameters or between the parameter name and value! So as an example use:

which renders as:

Typing aid: template mra
mra will duplicate the source text automatically, saving you the trouble of copying the text and adding nowiki tags to the first case.

This: Bold text

Will produce this:

Which renders as:

TemplateData
{	"description": " ", "paramOrder": [ "margin-left", "width", "style", "noheaders", "title", "tag", "colheaderstyle", "col1headerstyle", "col1", "col2headerstyle", "col2", "col1style", "col2style", "codestyle", "outputstyle", "1",		"2",		"3",		"4",		"39",		"40"	],	"params": { "1": {			"description": "row 1, first column (markup/code)'s content.", "type": "string" },		"2": {			"description": "row 1, second column (output)'s content.", "type": "string" },		"3": {			"description": "row 2, first column's content (etc).", "type": "string" },		"4": {			"description": "row 2, second column's content (etc).", "type": "string" },		"39": {			"description": "First column's content in last possible row.", "type": "string" },		"40": {			"description": "Second column's content in last possible row.", "type": "string" },		"width": { "description": "To set the table's overall width.", "type": "string", "default": "auto" },		"margin-left": { "description": "To set a margin on the table's lefthand side.", "type": "string", "default": "0" },		"style": { "description": "For CSS styles amending the table's overall appearance.", "type": "string" },		"title": { "description": "Title above table.", "type": "string", "default": "none" },		"tag": { "description": "Tag to use for markup. The default is pre and syntaxhighlight only works with single rows of text.", "type": "string", "default": "pre", "suggestedvalues": ["pre","syntaxhighlight"] },		"noheaders": { "description": "Set (as e.g. noheaders=on) to suppress the columns' headings and table's title.", "type": "string" },		"col1": { "description": "First column (markup/code)'s heading.", "type": "string", "default": "\"Markup\"" },		"col2": { "description": "Second column (output)'s heading.", "type": "string", "default": "\"Renders as\"" },		"codestyle": { "description": "Use CSS style code to change the appearance of content (text) in the Markup column.", "type": "string", "aliases": [ "markupstyle" ],			"label": "Markup text style", "example": "white-space: nowrap;" },		"outputstyle": { "description": "Use CSS style code to change the appearance of content (text) in the Renders-as column.", "type": "string", "label": "Output text style", "example": "white-space: nowrap;" },		"col1headerstyle": { "description": "For CSS styling to amend the appearance of the first column's heading. Overrides (but does not replace) colheaderstyle.", "type": "string" },		"col2headerstyle": { "description": "For CSS styling to amend the appearance of the second column's heading. Overrides (but does not replace) colheaderstyle.", "type": "string" },		"colheaderstyle": { "description": "For CSS styling to amend the appearance of each column's heading.", "type": "string" },		"col1style": { "label": "Column 1 Style", "description": "For CSS styles to amend the appearance of the markup column (e.g. width of the column).", "example": "width:20em;", "type": "string", "default": "none" },		"col2style": { "label": "Column 2 Style", "description": "For CSS styles to amend the appearance of the output column (e.g. the background colour).", "example": "background-color:#fff;", "type": "string", "default": "none" }	} }