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

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:

{{markup|<nowiki>'''Bold text'''</nowiki>|'''Bold text'''}}

Produces this:

Markup Renders as
'''Bold text'''

Bold text

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 {{mra}} to save yourself from copying the code twice.

  • Header markup such as == will show in the page table of contents; to avoid this, use {{fake heading}} 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.
  • Some templates may have error checking that places the page in a maintenance category.
    • Citation Style 1 templates with errors: add |template doc demo=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 &amp; 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 ;).

Multiple rows

ਸੋਧੋ
Markup Renders as
'''Bold text'''

Bold text

''Italic text''

Italic text

[[Internal link]]
{{cite book|ref=none|last=Smith|year=2021|title=Smith's book}}

Nakli itihaas jo likheya geya hai kade na vaapriya jo ohna de base te, saade te saada itihaas bna ke ehna ne thop dittiyan. anglo sikh war te ek c te 3-4 jagaha te kiwe chal rahi c ikko war utto saal 1848 jdo angrej sara punjab 1845 ch apne under kar chukke c te oh 1848 ch kihna nal jang ladd rahe c. Script error: The function "citation198.168.27.221 14:54, 13 ਦਸੰਬਰ 2024 (UTC)'"`UNIQ--ref-0000000E-QINU`"'</ref>" does not exist.

<score>\relative c' { c( b~ c b c b c b c~ c)}</score>
\relative c' { c( b~ c b c b c b c~ c)}

With custom title and column headers

ਸੋਧੋ
How to write about foxes and dogs in Wikipedia.
Write this in wikitext and this will appear in the article.
The quick brown [[fox]] jumps over the lazy [[dog]].

The quick brown fox jumps over the lazy dog.

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 Renders as
The quick brown fox jumps over the lazy dog.{{#tag:ref|A footnote.<ref>A reference for the footnote.</ref>|group=nb}} The cow jumped over the moon.{{fact}}

== Notes ==
{{reflist|group=nb}}

== References ==
{{reflist}}

The quick brown fox jumps over the lazy dog.[nb 1] The cow jumped over the moon.ਫਰਮਾ:Fake citation needed

Notes
  1. A footnote.[1]
References
  1. A reference for the footnote.

With HTML entities

ਸੋਧੋ

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

Markup Renders as
&ndash;

More examples

ਸੋਧੋ
Markup Renders as
{{cite book |last=White |first=T. H. |title=The Book of Merlyn |year=1977}}

Nakli itihaas jo likheya geya hai kade na vaapriya jo ohna de base te, saade te saada itihaas bna ke ehna ne thop dittiyan. anglo sikh war te ek c te 3-4 jagaha te kiwe chal rahi c ikko war utto saal 1848 jdo angrej sara punjab 1845 ch apne under kar chukke c te oh 1848 ch kihna nal jang ladd rahe c. Script error: The function "citation198.168.27.221 14:54, 13 ਦਸੰਬਰ 2024 (UTC)'"`UNIQ--ref-00000029-QINU`"'</ref>" does not exist.

{{code|lang=html|{{cite book |last=White |first=T. H. |title=The Book of Merlyn |year=1977}}}}

Nakli itihaas jo likheya geya hai kade na vaapriya jo ohna de base te, saade te saada itihaas bna ke ehna ne thop dittiyan. anglo sikh war te ek c te 3-4 jagaha te kiwe chal rahi c ikko war utto saal 1848 jdo angrej sara punjab 1845 ch apne under kar chukke c te oh 1848 ch kihna nal jang ladd rahe c. <strong class="error"><span class="scribunto-error mw-scribunto-error-3c5de105">Script error: The function &quot;citation[[ਖ਼ਾਸ:ਯੋਗਦਾਨ/198.168.27.221|198.168.27.221]] 14:54, 13 ਦਸੰਬਰ 2024 (UTC)'&quot;`UNIQ--ref-0000002B-QINU`&quot;'&lt;/ref&gt;&quot; does not exist.</span></strong>

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:

{{subst:mra|'''Bold text'''|''Italic text''}}

Will produce this:

{{markup|
<nowiki>'''Bold text'''</nowiki>|'''Bold text'''|
<nowiki>''Italic text''</nowiki>|''Italic text''}}

Which renders as:

Markup Renders as
'''Bold text'''

Bold text

''Italic text''

Italic text

  • {{Markup2}} for bulleted and indented markup.
  • {{Markupv}} for the vertical presentation (above/below) of markup/code and its output.
  • {{Automarkup}} does not require to write the code samples twice.

TemplateData

ਸੋਧੋ
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. Click here to see a monthly parameter usage report for Template:Markup based on its TemplateData.

TemplateData for Markup

ਫਰਮੇ ਦੇ ਮਾਪਦੰਡ

ਮਾਪਦੰਡਵੇਰਵਾਕਿਸਮਦਰਜਾ
margin-leftmargin-left

To set a margin on the table's lefthand side.

ਮੂਲ ਰੂਪ
0
Stringoptional
widthwidth

To set the table's overall width.

ਮੂਲ ਰੂਪ
auto
Stringoptional
stylestyle

For CSS styles amending the table's overall appearance.

Stringoptional
noheadersnoheaders

Set (as e.g. noheaders=on) to suppress the columns' headings and table's title.

Stringoptional
titletitle

Title above table.

Stringoptional
colheaderstylecolheaderstyle

For CSS styling to amend the appearance of each column's heading.

Stringoptional
col1headerstylecol1headerstyle

For CSS styling to amend the appearance of the first column's heading. Overrides (but does not replace) colheaderstyle.

Stringoptional
col1col1

First column (markup/code)'s heading.

ਮੂਲ ਰੂਪ
"Markup"
Stringoptional
col2headerstylecol2headerstyle

For CSS styling to amend the appearance of the second column's heading. Overrides (but does not replace) colheaderstyle.

Stringoptional
col2col2

Second column (output)'s heading.

ਮੂਲ ਰੂਪ
"Renders as"
Stringoptional
Column 1 stylecodestyle markupstyle

Use CSS style code to change the look of content in the Markup column.

Example
white-space: nowrap
Stringoptional
Column 2 styleoutputstyle

Use CSS style code to change the look of content in the Renders-as column.

Stringoptional
11

row 1, first column (markup/code)'s content.

Stringoptional
22

row 1, second column (output)'s content.

Stringoptional
33

row 2, first column's content (etc).

Stringoptional
44

row 2, second column's content (etc).

Stringoptional
3939

First column's content in last possible row.

Stringoptional
4040

Second column's content in last possible row.

Stringoptional