Template:Nb: Difference between revisions

From miki
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 5: Line 5:
<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!