Template:Bc: Difference between revisions
(Add bc template) |
(Add another code templates to list; simplify sections) |
||
Line 2: | Line 2: | ||
{{Template}} | {{Template}} | ||
Block code | Block code. | ||
* Use [[Template: | * Use [[Template:hbc]] for block code with header. | ||
* Use [[Template:hbc-hl]] for block code with header and with syntax highlighting. | |||
* Use [[Template:ic]] for inline code. | * Use [[Template:ic]] for inline code. | ||
* Use [[Template:ic-hl]] for inline code with syntax highlighting. | |||
==Usage== | == Usage example == | ||
{{bc|<nowiki>{{bc| | {{bc|<nowiki>{{bc|echo "Hello world"}}</nowiki>}} | ||
== | == Result == | ||
{{bc| | {{bc|echo "Hello world"}}</noinclude><includeonly><pre<noinclude></noinclude>>{{{code|{{{1|{{META Error}}}}}}}}</pre<noinclude></noinclude>></includeonly><noinclude><!-- The <noinclude></noinclude> hack is needed to allow wiki markup inside the pre tags; reference: http://www.gossamer-threads.com/lists/wiki/mediawiki/118688#118688 --></noinclude> |
Latest revision as of 20:06, 29 September 2023
This page is a template, editing it will affect all the pages that make use of it, so users should be especially careful when editing it. For more details on how to use templates see "A Quick Guide to Templates"
Block code.
- Use Template:hbc for block code with header.
- Use Template:hbc-hl for block code with header and with syntax highlighting.
- Use Template:ic for inline code.
- Use Template:ic-hl for inline code with syntax highlighting.
Usage example
{{bc|echo "Hello world"}}
Result
echo "Hello world"