|
|
| Line 1: |
Line 1: |
| | __NOTOC__ | | __NOTOC__ |
| − |
| |
| − | {{Template talk:Code}}
| |
| − |
| |
| − | == 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 = "string"; // sample initialization
| |
| − | ?>
| |
| − | </syntaxhighlight>
| |
| − | </pre>
| |
| − |
| |
| − | To look like:
| |
| − |
| |
| − | <syntaxhighlight lang="php">
| |
| − | <?php
| |
| − | $v = "string"; // sample initialization
| |
| − | ?>
| |
| − | </syntaxhighlight>
| |
| − |
| |
| − | or
| |
| − |
| |
| − | <pre>
| |
| − | <syntaxhighlight lang="ruby">
| |
| − | > ["Amahi", "Linux"].map{|i| "#{i} is cool!"}
| |
| − | => ["Amahi is cool!", "Linux is cool!"]
| |
| − | </syntaxhighlight>
| |
| − | </pre>
| |
| − |
| |
| − | To look like this:
| |
| − |
| |
| − | <syntaxhighlight lang="ruby">
| |
| − | > ["Amahi", "Linux"].map{|i| "#{i} is cool!"}
| |
| − | => ["Amahi is cool!", "Linux is cool!"]
| |
| − | </syntaxhighlight>
| |
| − |
| |
| − | 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.
| |
| − |
| |
| | ---- | | ---- |
| | {|width="100%" cellspacing="0" cellpadding="0" style="background-color: transparent" | | {|width="100%" cellspacing="0" cellpadding="0" style="background-color: transparent" |