Manual:Code Highlighting

From Codemotion
Jump to: navigation, search

Codemotion.net uses the GeSHi highlighting extension for its code highlighting. It uses the following synthax:

<source lang="langname" line start=1>
Source Code Here
</source>








Where "langname" is one of these:

abap, actionscript, actionscript3, ada, apache, applescript, apt_sources, asm, asp, autoit*, avisynth, bash, basic4gl, bf, blitzbasic, bnf, boo, c, c_mac, caddcl, cadlisp, cfdg, cfm, cil, cobol, cpp, cpp-qt, csharp, css, d, delphi, diff, div, dos, dot, eiffel, email, fortran, freebasic, genero, gettext, glsl, gml, gnuplot, groovy, haskell, hq9plus, html4strict, idl, ini, inno, intercal, io, java, java5, javascript, kixtart, klonec, klonecpp, latex, lisp, lolcode, lotusformulas, lotusscript, lscript, lua, m68k, make, matlab, mirc, mpasm, mxml, mysql, nsis, objc, ocaml, ocaml-brief, oobas, oracle11, oracle8, pascal, per, perl, php, php-brief, pic16, pixelbender, plsql, povray, powershell, progress, prolog, providex, python, qbasic, rails, reg, robots, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, tcl, teraterm, text, thinbasic, tsql, typoscript, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, winbatch, xml, xorg_conf, xpp, z80.

  • Note: Autoit highlighting is currently bugged. You can use "cpp" as an alternative.
  • If some wiki code is unexpectedly being inserted into your article, you can use the <nowiki> tag.

For example, the following input:

<source lang="cpp" line start=1>
include <iostream>
using namespace std;
int main()
{
cout << "Hello World";
return 0;
}
</source>














Will render:

  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. cout << "Hello World";
  6. return 0;
  7. }

You can also use the default templates that are preloaded in the create buttons:

Creates an article with a random name (Works, don't remove the "!!!").

For further reading:

Alternative Default Styles

Personal tools