User:Levi OP/Templates/Wiki Source Render
Wiki Source | Rendered Result |
---|---|
{{{1}}} |
{{{1}}} |
Usage
[edit]{{User:Levi OP/Templates/Wiki Source Render}} is a template used to show code examples of wikitext along with rendered version of the code. It could be used on the talk page of an article, or on a project page, to show how certain code runs and works.
Parameters
[edit]|1=
The wikitext that will be displayed on the right left side of the example. This text will also automatically be rendered adjacent to the plain text, if no separate text to be rendered is provided. (see directly below)
|2=
The wikitext to be rendered on the right side of the example. This is an optional parameter for examples where you want the back-end code to differ from the code in the example for a technical reason. For example, if you have a heading in your example, you want to use {{Fake heading}} in this argument so that the heading in your example is not added to the table of contents of the page.
|title=
takes text, and displays it as the label on the top of the table.
Examples
[edit]Using only |1=
:
{{User:Levi_OP/Templates/Wiki Source Render|<nowiki> Example of a citation: {{Cite web|url=https://example.com|title=Example citation|date=2022-01-01|website=Example Site}} </nowiki>}}
Wiki Source | Rendered Result |
---|---|
Example of a citation: {{Cite web|url=https://example.com|title=Example citation|date=2022-01-01|website=Example Site}} |
Example of a citation: "Example citation". Example Site. 2022-01-01. |
Using |1=
and |2=
:
{{User:Levi_OP/Templates/Wiki Source Render|<nowiki> == Heading == Here is some text And now a new line </nowiki>|<nowiki> {{fake heading|Heading}} Here is some text And now a new line </nowiki>}}
Wiki Source | Rendered Result |
---|---|
== Heading == Here is some text And now a new line |
Heading
Here is some text And now a new line |
Using |title=
:
{{User:Levi_OP/Templates/Wiki Source Render|title=Example from [[Example]]|<nowiki> Example text from [[Example]] </nowiki>}}
Wiki Source | Rendered Result |
---|---|
Example text from [[Example]] |
Example text from Example |