Template talk:Code
From Amahi Wiki
Code Formatting
To add formatting to code, we have a little code template that can be used like this:
Description | You type | You get | ||
---|---|---|---|---|
boxed code |
{{Code|lang = Bash | Code = bash$ ls -l total 696 ... bash$ }} |
| ||
lang parameter is optional default = text.
{{Code| Code = bash$ ls -l total 696 ... bash$ }}
Code Parameter name is optional. You have to use in case there are wiki symbols involeved If you type
{{Code|irc://<YouHdaIp>:26244/<channel>/?pass=<ZncUser>:<ZncUserPass>}}
you get
bash code |
---|
{{{1}}}
|
But
{{Code|Code= irc://<YouHdaIp>:26244/<channel>/?pass=<ZncUser>:<ZncUserPass>}}
bash code |
---|
irc://<YouHdaIp>:26244/<channel>/?pass=<ZncUser>:<ZncUserPass>
|
If you type
{{Code| Code= jQuery(document).ready(function(){ jQuery("#slider").easySlider({ auto: true, continuous: true, controlsShow: false, prevText: '', nextText: '', pause: 3000 }); });}}
you get
bash code |
---|
jQuery(document).ready(function(){ jQuery("#slider").easySlider({ auto: true, continuous: true, controlsShow: false, prevText: '', nextText: '', pause: 3000 }); });
|
BUT
{{Code|lang=JavaScript| Code= jQuery(document).ready(function(){ jQuery("#slider").easySlider({ auto: true, continuous: true, controlsShow: false, prevText: '', nextText: '', pause: 3000 }); });}}
JavaScript code |
---|
jQuery(document).ready(function(){ jQuery("#slider").easySlider({ auto: true, continuous: true, controlsShow: false, prevText: '', nextText: '', pause: 3000 }); });
|