Template:Bc: Difference between revisions

From Bibliotheca Anonoma
m (Protected "Template:Bc" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
No edit summary
Line 2: Line 2:
{{Template}}
{{Template}}


'''Block code without header.'''
'''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:hc]] for block code with header.
* Use [[Template:ic]] for inline code.
* Use [[Template:ic]] for inline code.
Line 9: Line 10:
==Usage==
==Usage==


{{bc|<nowiki>{{bc|code}}</nowiki>}}
<pre>{{bc|code}}</pre>


==Example==
{{bc|code}}


{{bc|code}}</noinclude><includeonly><pre<noinclude></noinclude>>{{{code|{{{1|{{META Error}}}}}}}}</pre<noinclude></noinclude>></includeonly><noinclude><!-- The &lt;noinclude>&lt;/noinclude> hack is needed to allow wiki markup inside the pre tags; reference: http://www.gossamer-threads.com/lists/wiki/mediawiki/118688#118688 --></noinclude>
=== Syntax Highlighting ===
 
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>
 
{{Bc|
# says hello
print "hello world"
 
# says goodbye
print "goodbye world"
|lang=python}}
 
</noinclude><includeonly>{{#tag:syntaxhighlight|{{{1|input}}}|lang={{{lang|php}}}}}</includeonly>

Revision as of 20:09, 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.

Usage

{{bc|code}}
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|print "hello world"|lang=python}}
# says hello
print "hello world"

# says goodbye
print "goodbye world"