Template:Bc: Difference between revisions
From Bibliotheca Anonoma
Antonizoon (talk | contribs) No edit summary |
Antonizoon (talk | contribs) No edit summary |
||
Line 10: | Line 10: | ||
==Usage== | ==Usage== | ||
<pre>{{bc|code}}</pre> | <pre>{{bc| | ||
block | |||
code | |||
}}</pre> | |||
{{bc|code}} | {{bc| | ||
block | |||
code | |||
}} | |||
=== Syntax Highlighting === | === Syntax Highlighting === | ||
Line 18: | Line 24: | ||
By specifying the language to use, you can get syntax highlighting as well. Here's a [[mw:Extension:SyntaxHighlight#Supported_languages|long list of supported languages.]] | By specifying the language to use, you can get syntax highlighting as well. Here's a [[mw:Extension:SyntaxHighlight#Supported_languages|long list of supported languages.]] | ||
<pre>{{Bc|print "hello world"|lang=python}}</pre> | <pre>{{Bc| | ||
# says hello | |||
print "hello world" | |||
# says goodbye | |||
print "goodbye world" | |||
|lang=python}}</pre> | |||
{{Bc| | {{Bc| |
Revision as of 20:11, 12 January 2017
This page is a template. It contains no Bibliotheca Anonoma-related information, but should be used as part of other articles. For more information, read Help:Template.
Please do not experiment with this template; you could ruin all pages using this template. If you want to edit this template, copy the text to Template:Sandbox, edit and test it there, and copy it back when it works.
Feel free to voice your opinion regarding this template.Block code without header or line numbers.
- Use Template:lc for block code with line numbers.
- Use Template:hc for block code with header.
- Use Template:ic for inline code.
Usage
{{bc| block code }}
block
code
Syntax Highlighting
By specifying the language to use, you can get syntax highlighting as well. Here's a long list of supported languages.
{{Bc| # says hello print "hello world" # says goodbye print "goodbye world" |lang=python}}
# says hello
print "hello world"
# says goodbye
print "goodbye world"