Template:Markup example
Jump to navigation
Jump to search
{{Markup example|<nowiki>...</nowiki>}}
Renders a side-by-side view of some raw wiki markup and what it will look like when saved to a page. This can be used to demonstrate basic wikitext functions, as well as for displaying live examples of template usage within documentation.
Parameters
- unnamed parameter 1
- Markup content. Usually this will be wrapped with a
<nowiki>tag to prevent premature expansion. - inline
- Optional. If y, preview will be rendered with an inline code block and an arrow, rather than as a side-by-side table.
- list
- Optional. If y, each line of input will be interpreted as a single markup example, and all the lines will be rendered in a list of inline examples. Very useful for dense template example pages, such as {{game icon}}.
Examples
Default layout
{{Markup example|<nowiki>'''Hello!'''</nowiki>}}
| Markup | Renders as |
|---|---|
'''Hello!''' |
Hello! |
Inline layout
{{Markup example|inline=y|<nowiki>'''Hello!'''</nowiki>}}
'''Hello!'''→ Hello!
List layout
{{Markup example|list=y|<nowiki>
'''Foo'''
''Bar''
<span class="error">Baz</span>
</nowiki>}}
'''Foo'''→ Foo''Bar''→ Bar<span class="error">Baz</span>→ Baz
Using <nowiki> within example markup
Escape inner </nowiki> closing tags by replacing the < with <:
{{Markup example|<nowiki>
{{Dialogue|<nowiki>
Alphinaud: Hello there!
</nowiki>}}
</nowiki>}}
| Markup | Renders as |
|---|---|
{{Dialogue|<nowiki>
Alphinaud: Hello there!
</nowiki>}}
|
Hello there! |
Further levels of escaping can be achieved by further escaping the & as & for each additional level of nesting, but I truly hope you never have to deal with that.