Template:Markup HTML Rendered/doc: Difference between revisions

Content deleted Content added
Copy Template:Markup/doc. See that page history for attribution.
 
Adapt to three column format
Line 3:
{{TOC right |limit=2}}
 
This template is used to present Wikitext markup or code side by side with the HTML it produces and the output it renders.
 
==Usage==
Each pair of {{tl|Markup HTML Rendered}}'s arguments should be twoprovided copiesin sets of somethree. [[wikitext]]The markup,first withof the firstset ofshould thebe pairWikitext enclosed in {{xtag|nowiki}} tags. The templatesecond producesshould outputbe HTML, also enclosed in two{{xtag|nowiki}} columns,tags. theThe firstthird showingis theusually markupidentical andto the secondfirst, showingbut howwithout it{{xtag|nowiki}} is renderedtags. The template accepts up to 40 unnamed parameters, resulting in up to 2013 rows of examples.
 
This:
<pre>
{{markupMarkup HTML Rendered|&lt;nowiki>'''Bold text'''&lt;/nowiki>|&lt;nowiki><b>Bold text</b>&lt;/nowiki>|'''Bold text'''}}
</pre>
 
Produces this:
{{markupMarkup HTML Rendered|<nowiki>'''Bold text'''</nowiki>|<nowiki><b>Bold text</b></nowiki>|'''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 {{tlx|mra}} to save yourself from copying the code twice.
 
* Header markup such as {{code|1===}} will show in the page table of contents; to avoid this, use {{tlx|fake heading}} in the markup for the secondthird column (see example [[#A complex example|below]]).
* Some templates will place the page in a maintenance category, which is usually undesired. For example.
** Instead of {{tlx|citation needed}}, use {{tlx|fake citation needed}} in the secondthird column.
* Some templates may have error checking that places the page in a maintenance category.
** <s>{{cs1}} templates with errors: add {{para|template doc demo|true}} to the template in the second column.</s>
Line 30 ⟶ 31:
 
===Multiple rows===
{{Markup HTML Rendered
{{markup
|<nowiki>'''Bold text'''</nowiki>|<nowiki><b>Bold text</b></nowiki>|'''Bold text'''
|<nowiki>''Italic text''</nowiki>|<nowiki><i>Italic text</i></nowiki>|''Italic text''
|<nowiki>[[Internal link]]</nowiki>|<nowiki><a href="">Internal link</a></nowiki>|[[Internal link]]
|<nowiki>
{{cite book|ref=none|last=Smith|year=2021|title=Smith's book}}
</nowiki>|
{{cite book|ref=none|last=Smith|year=2021|title=Smith's book}}
|<nowiki>
<score>\relative c' { c( b~ c b c b c b c~ c)}</score>
</nowiki>|
<score>\relative c' { c( b~ c b c b c b c~ c)}</score>
}}