Difference between revisions of "Template talk:SyntaxHighlight"
From Amahi Wiki
(Created page with "== Syntax Highlight for Code == If you like syntax highlighting, we have the syntax highlight extension and you can do this: <pre> <syntaxhighlight lang="php"> <?php $v = ...") |
|||
Line 1: | Line 1: | ||
+ | ---- | ||
+ | |||
== Syntax Highlight for Code == | == Syntax Highlight for Code == | ||
+ | |||
If you like syntax highlighting, we have the syntax highlight extension and you can do this: | If you like syntax highlighting, we have the syntax highlight extension and you can do this: | ||
Line 35: | Line 38: | ||
We have set the [http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi syntax highliting] extension with bash as the default language, since it's probably the most common in this wiki. You can override it as above. | We have set the [http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi syntax highliting] extension with bash as the default language, since it's probably the most common in this wiki. You can override it as above. | ||
+ | |||
[[Category:Help]] | [[Category:Help]] |
Revision as of 20:35, 2 January 2011
Syntax Highlight for Code
If you like syntax highlighting, we have the syntax highlight extension and you can do this:
<syntaxhighlight lang="php"> <?php $v = "string"; // sample initialization ?> </syntaxhighlight>
To look like:
<?php
$v = "string"; // sample initialization
?>
or
<syntaxhighlight lang="ruby"> > ["Amahi", "Linux"].map{|i| "#{i} is cool!"} => ["Amahi is cool!", "Linux is cool!"] </syntaxhighlight>
To look like this:
> ["Amahi", "Linux"].map{|i| "#{i} is cool!"}
=> ["Amahi is cool!", "Linux is cool!"]
We have set the syntax highliting extension with bash as the default language, since it's probably the most common in this wiki. You can override it as above.