Difference between revisions of "Help:Formating"

From Amahi Wiki
Jump to: navigation, search
(Created page with "{{Template talk:Code}} == Syntax Highlight for Code == If you like syntax highlighting, we have the syntax highlight extension and you can do this: <pre> <syntaxhighlight lang=...")
 
Line 37: Line 37:
  
 
We have set the [http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi 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.
 
We have set the [http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi 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.
 +
[[Category:Help]]

Revision as of 18:31, 2 January 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$ 
}}
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

Syntax Highlight for Code

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

<syntaxhighlight lang="php">
<?php
      $v = "string";    // sample initialization
?>
</syntaxhighlight>

To look like:

<?php
      $v = "string";    // sample initialization
?>

or

<syntaxhighlight lang="ruby">
> ["Amahi", "Linux"].map{|i| "#{i} is cool!"}
=> ["Amahi is cool!", "Linux is cool!"]
</syntaxhighlight>

To look like this:

       > ["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.