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|
Code = bash$ ls -l
total 696
...
bash$ 
}}
bash 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