Template:Ic: Difference between revisions
From Bibliotheca Anonoma
Antonizoon (talk | contribs) m (Protected "Template:Ic": High traffic page ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))) |
Antonizoon (talk | contribs) No edit summary |
||
Line 6: | Line 6: | ||
* Use [[Template:hc]] for block code with header. | * Use [[Template:hc]] for block code with header. | ||
==Usage== | == Usage == | ||
{{ | {{Note|By default, PHP highlighting is used, though it's pretty neutral.}} | ||
{{ | <pre><nowiki>{{Ic|hello moto}}</nowiki></pre> | ||
{{Ic|hello moto}} | |||
=== 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><nowiki>{{Ic|print "hello moto"|lang=python}}</nowiki></pre> | |||
{{ | {{Sandbox|print "hello moto"|lang=python}} | ||
{{ | {{Tip|When representing keyboard keys, you can use [[Wikipedia:List of XML and HTML character entity references|HTML entities]] {{ic|&uarr;}}, {{ic|&rarr;}}, {{ic|&darr;}} and {{ic|&larr;}} to depict arrow keys: {{ic|↑}}, {{ic|→}}, {{ic|↓}}, {{ic|←}}}} | ||
==Example== | ==Example== | ||
{{ic|code}}</noinclude><includeonly | {{ic|code}}</noinclude><includeonly>{{#tag:syntaxhighlight|{{{1|input}}}|lang={{{lang|php}}}|enclose=none}}</includeonly> |
Revision as of 19:34, 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.Inline code.
- Use Template:bc for block code without header.
- Use Template:hc for block code with header.
Usage
{{Ic|hello moto}}
hello moto
Syntax Highlighting
By specifying the language to use, you can get syntax highlighting as well. Here's a long list of supported languages.
{{Ic|print "hello moto"|lang=python}}
print "hello moto"
Example
code