Difference between revisions of "Template:Code"
From Mystcraft
(Updated font.) |
m |
||
Line 1: | Line 1: | ||
− | <includeonly><div style="border: solid #AAAAAA 1px; background-color: #F8F9F9; padding: 16px; font-family: | + | <includeonly><div style="border: solid #AAAAAA 1px; background-color: #F8F9F9; padding: 16px; font-family: 'Courier New', Courier, serif;">{{{1}}}</div></includeonly> |
<noinclude>This template can be used to display blocks of code. It has an advantage over the <nowiki><pre></nowiki> tag in that it can include text formatting. Line breaks must be explicitly stated using the ''<nowiki><br/></nowiki>'' element. There is only one parameter, so use this simple setup to call the template on any page: <code><nowiki>{{code|text}}</nowiki></code>. | <noinclude>This template can be used to display blocks of code. It has an advantage over the <nowiki><pre></nowiki> tag in that it can include text formatting. Line breaks must be explicitly stated using the ''<nowiki><br/></nowiki>'' element. There is only one parameter, so use this simple setup to call the template on any page: <code><nowiki>{{code|text}}</nowiki></code>. |
Latest revision as of 21:37, 3 September 2018
This template can be used to display blocks of code. It has an advantage over the <pre> tag in that it can include text formatting. Line breaks must be explicitly stated using the <br/> element. There is only one parameter, so use this simple setup to call the template on any page: {{code|text}}
.
Example
If you were to type this code:
{{code|'''The first line is bold.'''<br/>''The second line is italicized.''<br/>The third '''''word''''' in the third line is bold and italicized.}}
You would get this result:
The first line is bold.
The second line is italicized.
The third word in the third line is bold and italicized.
The second line is italicized.
The third word in the third line is bold and italicized.