سانچہ:Markup
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 ویکی markup, with the first of the pair enclosed in سانچہ:Xtag 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:
مارک اپ | بطور نتیجہ |
---|---|
'''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.
- Some templates may have error checking that places the page in a maintenance category.
اسلوب حوالہ 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 سانچہ:Xtag 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 ;).
Examples
[ترمیم]Multiple rows
[ترمیم]مارک اپ | بطور نتیجہ |
---|---|
'''Bold text''' |
Bold text |
''Italic text'' |
Italic text |
[[Internal link]] |
|
{{حوالہ کتاب|ref=none|last=Smith|year=2021|title=Smith's book}} |
Smith (2021)۔ Smith's book |
<score>\relative c' { c( b~ c b c b c b c~ c)}</score> |
![]() |
With custom title and column headers
[ترمیم]Write this in wikitext | and this will appear in the article. |
---|---|
The quick brown [[لومڑی]] jumps over the lazy [[کتا]]. |
|
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).
مارک اپ | بطور نتیجہ |
---|---|
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.{{حوالہ درکار}} == Notes == {{حوالہ جات|group=nb}} == References == {{حوالہ جات}} |
The quick brown fox jumps over the lazy dog.[nb 1] The cow jumped over the moon.سانچہ:Fake citation needed
|
With HTML entities
[ترمیم]HTML entities are parsed in the markup cell. To work around this, replace the &
with &
in the first column.
{{Markup| <nowiki>&ndash;</nowiki> | –}}
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:
{{markup |<nowiki>use <code>|lang = en</code></nowiki> |use <code>{{!}}lang {{=}} en</code> }}
which renders as:
مارک اپ | بطور نتیجہ |
---|---|
use <code>|lang = en</code> |
use |
More examples
[ترمیم]مارک اپ | بطور نتیجہ |
---|---|
{{حوالہ کتاب|last=White |first=T. H. |title=The Book of Merlyn |year=1977}} |
T. H. White (1977)۔ The Book of Merlyn |
{{کوڈ|lang=html|{{حوالہ کتاب|last=White |first=T. H. |title=The Book of Merlyn |year=1977}}}} |
|
{{mra}} will duplicate the source text automatically, saving you the trouble of copying the text and adding سانچہ:Xtag 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:
مارک اپ | بطور نتیجہ |
---|---|
'''Bold text''' |
Bold text |
''Italic text'' |
Italic text |
اوپر دی گئی دستاویز صفحہ سانچہ:Markup/دستاویز سے شامل کی گئی ہے۔ (ترمیم | تاریخچہ) صارفین سانچہ کے تختہ مشق (تخلیق | آئینہ) اور ثابتات (تخلیق) میں تجربات کرسکتے ہیں۔ براہ کرم /دستاویز کے ذیلی صفحہ پر زمرہ جات شامل فرمائیں۔ اس سانچہ کے ذیلی صفحات۔ |