Help:Formating

From Amahi


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


CodeLanguage
abapABAP
actionscriptActionScript
adaAda (programming language)
apacheApache HTTP Server
applescriptAppleScript
asmAssembly language
aspActive Server Pages
autoitAutoIt
bashBash (Unix shell)
basic4glBasic4GL
bfBrainfuck
blitzbasicBlitz BASIC
bnfBackus-Naur Form
cC (programming language)
c_macC (Mac)
caddclDialog Control Language
cadlispAutoLISP
cfdgCFDG
cfmColdFusion Markup Language
cilCommon Intermediate Language
cobolCOBOL
cpp-qtQt (toolkit)
cppC++
csharpC Sharp (programming language)
cssCascading Style Sheets
dD (programming language)
delphiDelphi programming language
diffdiff
divDIV
dosDOS batch file
dotDOT language
eiffelEiffel (programming language)
fortranFortran
freebasicFreeBASIC
generoGenero
gettextGNU gettext
glslGLSL
gmlGame Maker Language
gnuplotGnuplot
groovyGroovy (programming language)
haskellHaskell (programming language)
hq9plusHQ9+
html4strictHTML
idlUniversal Network Objects
iniINI file
innoInno Setup
intercalINTERCAL
ioIo (programming language)
javaJava (programming language)
java5Java (programming language)
javascriptJavaScript
kixtartKiXtart
klonecKlone C
klonecppKlone C++
latexLaTeX
lispLisp (programming language)
lolcodeLOLCODE
lotusscriptLotusScript
luaLua (programming language)
CodeLanguage
m68kMotorola 68000
makeMake(software)
matlabMATLAB
mircmIRC scripting language
mxmlMXML
mpasmPIC microcontroller
mysqlMySQL
nsisNullsoft Scriptable Install System
objcObjective-C
ocaml-briefObjective Caml
ocamlObjective Caml
oobasStarOffice Basic
oracle8PL/SQL
oracle11PL/SQL
pascalPascal (programming language)
perper
perlPerl
php-briefPHP
phpPHP
pixelbenderAdobe Pixel Bender
plsqlPL/SQL
povrayPOV-Ray
powershellWindows PowerShell
progressOpenEdge Advanced Business Language
prologProlog
providexProvideX
pythonPython (programming language)
qbasicQBasic
railsRuby on Rails
regWindows Registry
robotsRobots Exclusion Standard
rubyRuby (programming language)
rsplusR (programming language)
sasSAS System
scalaScala )
schemeScheme (programming language)
scilabScilab
sdlbasicSdlBasic
smalltalkSmalltalk
smartySmarty
sqlSQL
tclTcl
teratermTeraTerm
textPlain text
thinbasicthinBasic
tsqlTransact-SQL
typoscriptTYPO3
vbVisual Basic
vbnetVisual Basic .NET
verilogVerilog
vhdlVHSIC Hardware Description Language
vimVimscript
visualfoxproVisual FoxPro
visualprologVisual_Prolog
whitespaceWhitespace programming language)
winbatchWinbatch
xmlXML
xorg_confXorg.conf
xppMicrosoft Dynamics AX
z80Zilog Z80


Syntax Highlight for Code

If you like syntax highlighting, we have the syntax highlight extension and you can do this:

Language
lang="php" you type
<syntaxhighlight lang="php">
<?php
      $v = "string";    // sample initialization
?>
</syntaxhighlight>
you get
<?php
      $v = "string";    // sample initialization
?>
lang="ruby" you type
<syntaxhighlight lang="ruby">
> ["Amahi", "Linux"].map{|i| "#{i} is cool!"}
=> ["Amahi is cool!", "Linux is cool!"]
</syntaxhighlight>
you get
> ["Amahi", "Linux"].map{|i| "#{i} is cool!"}
=> ["Amahi is cool!", "Linux is cool!"]

We have set the syntax highliting extension with bash as the default language, since it's probably the most common in this wiki. You can override it as above.



More help for the wiki in general