Template:Demo

From PCSAR

(Difference between revisions)
Jump to: navigation, search

Brett Wuth (Talk | contribs)
(New page: <noinclude>{{documentation}}</noinclude><includeonly> {{Demo table| {{Demo row|{{{1}}}|{{{2|{{{1}}}}}}}} }} </includeonly>)
Next diff →

Current revision

This is the documentation for the template Template:Demo

Template:Demo/Doc:

This template is used to create a demonstration of a mediawiki technique.

It shows both what you type and what you get. Such as:


You type... You get...
I want '''this in bold''' 
I want this in bold



With mediawiki markup you only have to type the demonstration once, like this:

{{demo|I want ''this in italic''}}

to get:


You type... You get...
I want ''this in italic'' 
I want this in italic



If your demonstration includes a call to template, include it twice and put the first call inside nowiki's, like this:

{{demo|<nowiki>{{estimate|8h|5h}}</nowiki><!--
-->   |        {{estimate|8h|5h}} }}

To get:


You type... You get...
{{estimate|8h|5h}}    
(estimate 8h, so far 5h)


If you don't use nowiki's, the template will be expanded in the "You type" section.

For clarity the first and second use of the demonstration text are aligned under each other. That way you when you are editing the text, can see that they are character identical. In order to avoid an extra blank line, the line break is commented out with <!-- ... -->.

If you want to include multiple examples in one table, use Template:Demo table.


To see how this template is implemented, edit this page and examine the portion between <includeonly> and </includeonly>.

Personal tools