Difference between revisions of "Help:Contents"
From Amahi Wiki
Line 5: | Line 5: | ||
* [http://www.mediawiki.org/wiki/Help:Images Images] | * [http://www.mediawiki.org/wiki/Help:Images Images] | ||
* [http://www.mediawiki.org/wiki/Help:Tables Tables] | * [http://www.mediawiki.org/wiki/Help:Tables Tables] | ||
+ | |||
+ | = Code Formatting = | ||
To add formatting to code, we have a little [[Template:Code code template]] that can be used like this: | To add formatting to code, we have a little [[Template:Code code template]] that can be used like this: | ||
<pre> | <pre> | ||
− | ::{{Code|$ this is a bash command | + | ::{{Code|bash$ this is a bash command |
-bash: this: command not found | -bash: this: command not found | ||
− | $ | + | bash$ |
}} | }} | ||
</pre> | </pre> | ||
Line 17: | Line 19: | ||
Which should look like this: | Which should look like this: | ||
− | ::{{Code|$ this is a bash command | + | ::{{Code|bash$ this is a bash command |
-bash: this: command not found | -bash: this: command not found | ||
− | $ | + | bash$ |
}} | }} | ||
+ | |||
+ | 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 ?> | ||
+ | This is some html text | ||
+ | </syntaxhighlight> | ||
+ | </pre> | ||
+ | |||
+ | To look like: | ||
+ | |||
+ | <syntaxhighlight lang="php"> | ||
+ | <?php $v = "string"; // sample initialization ?> | ||
+ | This is some html text | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | or | ||
+ | |||
+ | <pre> | ||
+ | <syntaxhighlight lang="ruby"> | ||
+ | > ["Amahi", "Linux"].map{|i| "#{i} is cool!"} | ||
+ | => ["Amahi is cool!", "Linux is cool!"] | ||
+ | </syntaxhighlight> | ||
+ | </pre> | ||
+ | |||
+ | To look like: | ||
+ | |||
+ | <syntaxhighlight lang="ruby"> | ||
+ | > ["Amahi", "Linux"].map{|i| "#{i} is cool!"} | ||
+ | => ["Amahi is cool!", "Linux is cool!"] | ||
+ | </syntaxhighlight> | ||
[http://meta.wikimedia.org/wiki/Help:Editing Complete editing help] | [http://meta.wikimedia.org/wiki/Help:Editing Complete editing help] |
Revision as of 00:12, 2 January 2011
Help Topics
Wiki Formatting:
Code Formatting
To add formatting to code, we have a little Template:Code code template that can be used like this:
::{{Code|bash$ this is a bash command -bash: this: command not found bash$ }}
Which should look like this:
bash code |
---|
bash$ this is a bash command -bash: this: command not found bash$
|
If you like syntax highlighting, we have the syntax highlight extension and you can do this:
<syntaxhighlight lang="php"> <?php $v = "string"; // sample initialization ?> This is some html text </syntaxhighlight>
To look like:
<?php $v = "string"; // sample initialization ?>
This is some html text
or
<syntaxhighlight lang="ruby"> > ["Amahi", "Linux"].map{|i| "#{i} is cool!"} => ["Amahi is cool!", "Linux is cool!"] </syntaxhighlight>
To look like:
> ["Amahi", "Linux"].map{|i| "#{i} is cool!"}
=> ["Amahi is cool!", "Linux is cool!"]