Difference between revisions of "Template talk:Code"
From Amahi Wiki
(9 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
---- | ---- | ||
+ | |||
= Code Formatting = | = 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|bash$ ls -l | {{Code|bash$ ls -l | ||
Line 19: | Line 20: | ||
bash$ | bash$ | ||
}} | }} | ||
− | -- | + | --> |
− | {| | + | {|style="width: 99%; border-width: 1px; border-style: solid; border-color: #aaa" |
! Description | ! Description | ||
! width=40% | You type | ! width=40% | You type | ||
Line 26: | Line 27: | ||
|- | |- | ||
|boxed code | |boxed code | ||
− | |<pre> | + | | |
− | {{Code|bash$ ls -l | + | <pre> |
+ | {{Code| | ||
+ | Code = bash$ ls -l | ||
total 696 | total 696 | ||
... | ... | ||
Line 33: | Line 36: | ||
}} | }} | ||
</pre> | </pre> | ||
− | |{{Code|bash$ ls -l | + | | |
+ | {| | ||
+ | {{Code| | ||
+ | Code = bash$ ls -l | ||
total 696 | total 696 | ||
... | ... | ||
Line 39: | Line 45: | ||
}} | }} | ||
|} | |} | ||
+ | |} | ||
+ | |||
+ | lang parameter is optional default = bash. | ||
+ | |||
+ | <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 | ||
+ | <pre> | ||
+ | {{Code|lang=JavaScript| | ||
+ | Code= jQuery(document).ready(function(){ | ||
+ | jQuery("#slider").easySlider({ | ||
+ | auto: true, | ||
+ | continuous: true, | ||
+ | controlsShow: false, | ||
+ | prevText: '', | ||
+ | nextText: '', | ||
+ | pause: 3000 | ||
+ | }); | ||
+ | });}} | ||
+ | </pre> | ||
+ | |||
+ | {{Code|lang=JavaScript| | ||
+ | Code= jQuery(document).ready(function(){ | ||
+ | jQuery("#slider").easySlider({ | ||
+ | auto: true, | ||
+ | continuous: true, | ||
+ | controlsShow: false, | ||
+ | prevText: '', | ||
+ | nextText: '', | ||
+ | pause: 3000 | ||
+ | }); | ||
+ | });}} | ||
+ | |||
+ | {| class="wikitable" style="float:left" | ||
+ | !Code||Language | ||
+ | |- | ||
+ | |<code>abap</code>||ABAP | ||
+ | |- | ||
+ | |<code>actionscript</code>||ActionScript | ||
+ | |- | ||
+ | |<code>ada</code>||Ada (programming language) | ||
+ | |- | ||
+ | |<code>apache</code>||Apache HTTP Server | ||
+ | |- | ||
+ | |<code>applescript</code>||AppleScript | ||
+ | |- | ||
+ | |<code>asm</code>||Assembly language | ||
+ | |- | ||
+ | |<code>asp</code>||Active Server Pages | ||
+ | |- | ||
+ | |<code>autoit</code>||AutoIt | ||
+ | |- | ||
+ | |<code>bash</code>||Bash (Unix shell) | ||
+ | |- | ||
+ | |<code>basic4gl</code>||Basic4GL | ||
+ | |- | ||
+ | |<code>bf</code>||Brainfuck | ||
+ | |- | ||
+ | |<code>blitzbasic</code>||Blitz BASIC | ||
+ | |- | ||
+ | |<code>bnf</code>||Backus-Naur Form | ||
+ | |- | ||
+ | |<code>c</code>||C (programming language) | ||
+ | |- | ||
+ | |<code>c_mac</code>||C (Mac) | ||
+ | |- | ||
+ | |<code>caddcl</code>||Dialog Control Language | ||
+ | |- | ||
+ | |<code>cadlisp</code>||AutoLISP | ||
+ | |- | ||
+ | |<code>cfdg</code>||CFDG | ||
+ | |- | ||
+ | |<code>cfm</code>||ColdFusion Markup Language | ||
+ | |- | ||
+ | |<code>cil</code>||Common Intermediate Language | ||
+ | |- | ||
+ | |<code>cobol</code>||COBOL | ||
+ | |- | ||
+ | |<code>cpp-qt</code>||Qt (toolkit) | ||
+ | |- | ||
+ | |<code>cpp</code>||C++ | ||
+ | |- | ||
+ | |<code>csharp</code>||C Sharp (programming language) | ||
+ | |- | ||
+ | |<code>css</code>||Cascading Style Sheets | ||
+ | |- | ||
+ | |<code>d</code>||D (programming language) | ||
+ | |- | ||
+ | |<code>delphi</code>||Delphi programming language | ||
+ | |- | ||
+ | |<code>diff</code>||diff | ||
+ | |- | ||
+ | |<code>div</code>||DIV | ||
+ | |- | ||
+ | |<code>dos</code>||DOS batch file | ||
+ | |- | ||
+ | |<code>dot</code>||DOT language | ||
+ | |- | ||
+ | |<code>eiffel</code>||Eiffel (programming language) | ||
+ | |- | ||
+ | |<code>fortran</code>||Fortran | ||
+ | |- | ||
+ | |<code>freebasic</code>||FreeBASIC | ||
+ | |- | ||
+ | |<code>genero</code>||Genero | ||
+ | |- | ||
+ | |<code>gettext</code>||GNU gettext | ||
+ | |- | ||
+ | |<code>glsl</code>||GLSL | ||
+ | |- | ||
+ | |<code>gml</code>||Game Maker Language | ||
+ | |- | ||
+ | |<code>gnuplot</code>||Gnuplot | ||
+ | |- | ||
+ | |<code>groovy</code>||Groovy (programming language) | ||
+ | |- | ||
+ | |<code>haskell</code>||Haskell (programming language) | ||
+ | |- | ||
+ | |<code>hq9plus</code>||HQ9+ | ||
+ | |- | ||
+ | |<code>html4strict</code>||HTML | ||
+ | |- | ||
+ | |<code>idl</code>||Universal Network Objects | ||
+ | |- | ||
+ | |<code>ini</code>||INI file | ||
+ | |- | ||
+ | |<code>inno</code>||Inno Setup | ||
+ | |- | ||
+ | |<code>intercal</code>||INTERCAL | ||
+ | |- | ||
+ | |<code>io</code>||Io (programming language) | ||
+ | |- | ||
+ | |<code>java</code>||Java (programming language) | ||
+ | |- | ||
+ | |<code>java5</code>||Java (programming language) | ||
+ | |- | ||
+ | |<code>javascript</code>||JavaScript | ||
+ | |- | ||
+ | |<code>kixtart</code>||KiXtart | ||
+ | |- | ||
+ | |<code>klonec</code>||Klone C | ||
+ | |- | ||
+ | |<code>klonecpp</code>||Klone C++ | ||
+ | |- | ||
+ | |<code>latex</code>||LaTeX | ||
+ | |- | ||
+ | |<code>lisp</code>||Lisp (programming language) | ||
+ | |- | ||
+ | |<code>lolcode</code>||LOLCODE | ||
+ | |- | ||
+ | |<code>lotusscript</code>||LotusScript | ||
+ | |- | ||
+ | |<code>lua</code>||Lua (programming language) | ||
+ | |} | ||
+ | {| class="wikitable" style="float:left" | ||
+ | !Code||Language | ||
+ | |- | ||
+ | |<code>m68k</code>||Motorola 68000 | ||
+ | |- | ||
+ | |<code>make</code>||Make(software) | ||
+ | |- | ||
+ | |<code>matlab</code>||MATLAB | ||
+ | |- | ||
+ | |<code>mirc</code>||mIRC scripting language | ||
+ | |- | ||
+ | |<code>mxml</code>||MXML | ||
+ | |- | ||
+ | |<code>mpasm</code>||PIC microcontroller | ||
+ | |- | ||
+ | |<code>mysql</code>||MySQL | ||
+ | |- | ||
+ | |<code>nsis</code>||Nullsoft Scriptable Install System | ||
+ | |- | ||
+ | |<code>objc</code>||Objective-C | ||
+ | |- | ||
+ | |<code>ocaml-brief</code>||Objective Caml | ||
+ | |- | ||
+ | |<code>ocaml</code>||Objective Caml | ||
+ | |- | ||
+ | |<code>oobas</code>||StarOffice Basic | ||
+ | |- | ||
+ | |<code>oracle8</code>||PL/SQL | ||
+ | |- | ||
+ | |<code>oracle11</code>||PL/SQL | ||
+ | |- | ||
+ | |<code>pascal</code>||Pascal (programming language) | ||
+ | |- | ||
+ | |<code>per</code>||per | ||
+ | |- | ||
+ | |<code>perl</code>||Perl | ||
+ | |- | ||
+ | |<code>php-brief</code>||PHP | ||
+ | |- | ||
+ | |<code>php</code>||PHP | ||
+ | |- | ||
+ | |<code>pixelbender</code>||Adobe Pixel Bender | ||
+ | |- | ||
+ | |<code>plsql</code>||PL/SQL | ||
+ | |- | ||
+ | |<code>povray</code>||POV-Ray | ||
+ | |- | ||
+ | |<code>powershell</code>||Windows PowerShell | ||
+ | |- | ||
+ | |<code>progress</code>||OpenEdge Advanced Business Language | ||
+ | |- | ||
+ | |<code>prolog</code>||Prolog | ||
+ | |- | ||
+ | |<code>providex</code>||ProvideX | ||
+ | |- | ||
+ | |<code>python</code>||Python (programming language) | ||
+ | |- | ||
+ | |<code>qbasic</code>||QBasic | ||
+ | |- | ||
+ | |<code>rails</code>||Ruby on Rails | ||
+ | |- | ||
+ | |<code>reg</code>||Windows Registry | ||
+ | |- | ||
+ | |<code>robots</code>||Robots Exclusion Standard | ||
+ | |- | ||
+ | |<code>ruby</code>||Ruby (programming language) | ||
+ | |- | ||
+ | |<code>rsplus</code>||R (programming language) | ||
+ | |- | ||
+ | |<code>sas</code>||SAS System | ||
+ | |- | ||
+ | |<code>scala</code>||Scala ) | ||
+ | |- | ||
+ | |<code>scheme</code>||Scheme (programming language) | ||
+ | |- | ||
+ | |<code>scilab</code>||Scilab | ||
+ | |- | ||
+ | |<code>sdlbasic</code>||SdlBasic | ||
+ | |- | ||
+ | |<code>smalltalk</code>||Smalltalk | ||
+ | |- | ||
+ | |<code>smarty</code>||Smarty | ||
+ | |- | ||
+ | |<code>sql</code>||SQL | ||
+ | |- | ||
+ | |<code>tcl</code>||Tcl | ||
+ | |- | ||
+ | |<code>teraterm</code>||TeraTerm | ||
+ | |- | ||
+ | |<code>text</code>||Plain text | ||
+ | |- | ||
+ | |<code>thinbasic</code>||thinBasic | ||
+ | |- | ||
+ | |<code>tsql</code>||Transact-SQL | ||
+ | |- | ||
+ | |<code>typoscript</code>||TYPO3 | ||
+ | |- | ||
+ | |<code>vb</code>||Visual Basic | ||
+ | |- | ||
+ | |<code>vbnet</code>||Visual Basic .NET | ||
+ | |- | ||
+ | |<code>verilog</code>||Verilog | ||
+ | |- | ||
+ | |<code>vhdl</code>||VHSIC Hardware Description Language | ||
+ | |- | ||
+ | |<code>vim</code>||Vimscript | ||
+ | |- | ||
+ | |<code>visualfoxpro</code>||Visual FoxPro | ||
+ | |- | ||
+ | |<code>visualprolog</code>||Visual_Prolog | ||
+ | |- | ||
+ | |<code>whitespace</code>||Whitespace programming language) | ||
+ | |- | ||
+ | |<code>winbatch</code>||Winbatch | ||
+ | |- | ||
+ | |<code>xml</code>||XML | ||
+ | |- | ||
+ | |<code>xorg_conf</code>||Xorg.conf | ||
+ | |- | ||
+ | |<code>xpp</code>||Microsoft Dynamics AX | ||
+ | |- | ||
+ | |<code>z80</code>||Zilog Z80 | ||
+ | |} | ||
+ | |||
+ | [[Category:Help]] |
Latest revision as of 02:43, 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| Code = bash$ ls -l total 696 ... bash$ }} |
| ||
lang parameter is optional default = bash.
{{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 }); });
|
Code | Language |
---|---|
abap |
ABAP |
actionscript |
ActionScript |
ada |
Ada (programming language) |
apache |
Apache HTTP Server |
applescript |
AppleScript |
asm |
Assembly language |
asp |
Active Server Pages |
autoit |
AutoIt |
bash |
Bash (Unix shell) |
basic4gl |
Basic4GL |
bf |
Brainfuck |
blitzbasic |
Blitz BASIC |
bnf |
Backus-Naur Form |
c |
C (programming language) |
c_mac |
C (Mac) |
caddcl |
Dialog Control Language |
cadlisp |
AutoLISP |
cfdg |
CFDG |
cfm |
ColdFusion Markup Language |
cil |
Common Intermediate Language |
cobol |
COBOL |
cpp-qt |
Qt (toolkit) |
cpp |
C++ |
csharp |
C Sharp (programming language) |
css |
Cascading Style Sheets |
d |
D (programming language) |
delphi |
Delphi programming language |
diff |
diff |
div |
DIV |
dos |
DOS batch file |
dot |
DOT language |
eiffel |
Eiffel (programming language) |
fortran |
Fortran |
freebasic |
FreeBASIC |
genero |
Genero |
gettext |
GNU gettext |
glsl |
GLSL |
gml |
Game Maker Language |
gnuplot |
Gnuplot |
groovy |
Groovy (programming language) |
haskell |
Haskell (programming language) |
hq9plus |
HQ9+ |
html4strict |
HTML |
idl |
Universal Network Objects |
ini |
INI file |
inno |
Inno Setup |
intercal |
INTERCAL |
io |
Io (programming language) |
java |
Java (programming language) |
java5 |
Java (programming language) |
javascript |
JavaScript |
kixtart |
KiXtart |
klonec |
Klone C |
klonecpp |
Klone C++ |
latex |
LaTeX |
lisp |
Lisp (programming language) |
lolcode |
LOLCODE |
lotusscript |
LotusScript |
lua |
Lua (programming language) |
Code | Language |
---|---|
m68k |
Motorola 68000 |
make |
Make(software) |
matlab |
MATLAB |
mirc |
mIRC scripting language |
mxml |
MXML |
mpasm |
PIC microcontroller |
mysql |
MySQL |
nsis |
Nullsoft Scriptable Install System |
objc |
Objective-C |
ocaml-brief |
Objective Caml |
ocaml |
Objective Caml |
oobas |
StarOffice Basic |
oracle8 |
PL/SQL |
oracle11 |
PL/SQL |
pascal |
Pascal (programming language) |
per |
per |
perl |
Perl |
php-brief |
PHP |
php |
PHP |
pixelbender |
Adobe Pixel Bender |
plsql |
PL/SQL |
povray |
POV-Ray |
powershell |
Windows PowerShell |
progress |
OpenEdge Advanced Business Language |
prolog |
Prolog |
providex |
ProvideX |
python |
Python (programming language) |
qbasic |
QBasic |
rails |
Ruby on Rails |
reg |
Windows Registry |
robots |
Robots Exclusion Standard |
ruby |
Ruby (programming language) |
rsplus |
R (programming language) |
sas |
SAS System |
scala |
Scala ) |
scheme |
Scheme (programming language) |
scilab |
Scilab |
sdlbasic |
SdlBasic |
smalltalk |
Smalltalk |
smarty |
Smarty |
sql |
SQL |
tcl |
Tcl |
teraterm |
TeraTerm |
text |
Plain text |
thinbasic |
thinBasic |
tsql |
Transact-SQL |
typoscript |
TYPO3 |
vb |
Visual Basic |
vbnet |
Visual Basic .NET |
verilog |
Verilog |
vhdl |
VHSIC Hardware Description Language |
vim |
Vimscript |
visualfoxpro |
Visual FoxPro |
visualprolog |
Visual_Prolog |
whitespace |
Whitespace programming language) |
winbatch |
Winbatch |
xml |
XML |
xorg_conf |
Xorg.conf |
xpp |
Microsoft Dynamics AX |
z80 |
Zilog Z80 |