Template:Nb: Difference between revisions

From miki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<html><div class="noborder">
<div class="noborder">
</html>{{{1}}}<html></div></html><noinclude>
{{{1}}}</div><noinclude>
<br/><br/>
<br/><br/>
The template '''{{PAGENAME}}''' creates a <code>&lt;div class="border"&gt;</code> tag. Along with a style definition in [[MediaWiki:Common.css]], it is used to remove the border around <code>&lt;source&gt;</code> tags. Example:
The template '''{{PAGENAME}}''' creates a <code>&lt;div class="border"&gt;</code> tag. Along with a style definition in [[MediaWiki:Common.css]], it is used to remove the border around <code>&lt;source&gt;</code> tags. Example:
<pre>
<pre>
* An example of Bash script:
* An example of Bash script:
{{nb|<source lang="bash">echo Hello, World!</source>}}
{{nb|1=<source lang=bash>echo Hello, World!</source>}}
</pre>
</pre>
This gives:
This gives:
* An example of Bash script:
* An example of Bash script:
{{nb|<source lang="bash">echo Hello, World!</source>}}
{{nb|1=<source lang=bash>echo Hello, World!</source>}}


Alternatively, one can add parameter <code>enclose=none</code> to <code>source</code> tag:
<pre>
Using nb template:
{{nb|1=<source lang=bash>echo Hello, World!</source>}}
Using enclose=none:
<source lang=bash enclose=none>echo Hello, World!</source>
</pre>

gives

Using nb template:
{{nb|1=<source lang=bash>echo Hello, World!</source>}}
Using enclose=none:
<source lang=bash enclose=none>echo Hello, World!</source>

</noinclude>
</noinclude>

Latest revision as of 16:58, 15 January 2014

{{{1}}}



The template Nb creates a <div class="border"> tag. Along with a style definition in MediaWiki:Common.css, it is used to remove the border around <source> tags. Example:

* An example of Bash script:
{{nb|1=<source lang=bash>echo Hello, World!</source>}}

This gives:

  • An example of Bash script:
echo Hello, World!


Alternatively, one can add parameter enclose=none to source tag:

Using nb template:
{{nb|1=<source lang=bash>echo Hello, World!</source>}}
Using enclose=none:
<source lang=bash enclose=none>echo Hello, World!</source>

gives

Using nb template:

echo Hello, World!

Using enclose=none: echo Hello, World!