Template talk:Code

From Amahi Wiki
Jump to: navigation, search

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$ 
}}
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

bash code
​jQuery(document).ready(function(){ jQuery("#slider").easySlider({ auto: true, continuous: true, controlsShow: false, prevText: '', nextText: '', pause: 3000 }); });​​