Difference between revisions of "Template talk:Code"

From Amahi Wiki
Jump to: navigation, search
Line 29: Line 29:
 
|
 
|
 
<pre>
 
<pre>
{{Code|Lang = bash |
+
{{Code|Lang = Bash |
 
Code = bash$ ls -l
 
Code = bash$ ls -l
 
total 696
 
total 696
Line 38: Line 38:
 
|
 
|
 
{|
 
{|
{{Code|Lang = bash |
+
{{Code|Lang = Bash |
 
Code = bash$ ls -l
 
Code = bash$ ls -l
 
total 696
 
total 696
Line 46: Line 46:
 
|}
 
|}
 
|}
 
|}
 +
 +
Lang parameter is optional default = text.
 +
 +
<pre>
 +
{{Code|
 +
Code = bash$ ls -l
 +
total 696
 +
...
 +
bash$
 +
}}
 +
</pre>
 +
 +
Code Parameter name is optional. You have to use in case there are wiki symbols involeved
 +
If you type
 +
<pre>
 +
{{Code|​irc://<YouHdaIp>:26244/<channel>/?pass=<ZncUser>:<ZncUserPass>​}}
 +
</pre>
 +
you get
 +
{{Code|​irc://<YouHdaIp>:26244/<channel>/?pass=<ZncUser>:<ZncUserPass>​}}
 +
But
 +
<pre>
 +
{{Code|Code= ​irc://<YouHdaIp>:26244/<channel>/?pass=<ZncUser>:<ZncUserPass>​}}
 +
</pre>
 +
{{Code|Code= ​irc://<YouHdaIp>:26244/<channel>/?pass=<ZncUser>:<ZncUserPass>​}}
 +
 +
If you type
 +
<pre>
 +
{{Code|
 +
  Code= jQuery(document).ready(function(){
 +
  jQuery("#slider").easySlider({
 +
  auto: true,
 +
  continuous: true,
 +
  controlsShow: false,
 +
  prevText: '',
 +
  nextText: '',
 +
  pause: 3000
 +
  });
 +
});​}}
 +
</pre>
 +
you get
 +
{{Code|
 +
  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
 +
  });
 +
});​}}
 
[[Category:Help]]
 
[[Category:Help]]

Revision as of 01:42, 6 February 2011


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 }); });​​