Difference between revisions of "Help:Token Coloring"
(→Other Languages: <code> tag is changed to <source>) |
m (→Other Languages: lang) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 31: | Line 31: | ||
Other programming languages can be token colored using | Other programming languages can be token colored using | ||
<nowiki><source | <nowiki><source lang="XXXX"> ... </source></nowiki> | ||
where XXXX indicates a programming (see below for supported languages). | where XXXX indicates a programming (see below for supported languages). | ||
Line 37: | Line 37: | ||
If you for example write: | If you for example write: | ||
<nowiki><source | <nowiki><source lang="java">/** "ConcreteImplementor" 1/2 */ | ||
class DrawingAPI1 implements DrawingAPI { | class DrawingAPI1 implements DrawingAPI { | ||
public void drawCircle(double x, double y, double radius) { | public void drawCircle(double x, double y, double radius) { | ||
Line 46: | Line 46: | ||
The result will be like this: | The result will be like this: | ||
<source | <source lang="java">/** "ConcreteImplementor" 1/2 */ | ||
class DrawingAPI1 implements DrawingAPI { | class DrawingAPI1 implements DrawingAPI { | ||
public void drawCircle(double x, double y, double radius) { | public void drawCircle(double x, double y, double radius) { | ||
Line 53: | Line 53: | ||
}</source > | }</source > | ||
==Supported Languages== | == Supported Languages == | ||
< | <source language="list" /> | ||
== References == | |||
[[Category:Wiki Edit]] | |||
[[Category:Help|{{PAGENAME}}]] |
Latest revision as of 13:22, 28 November 2012
You can automatically apply token coloring to code written in a large number of programming languages, notably Visual Prolog.
Visual Prolog Token Coloring
If you write:
<vip>some Visual Prolog code</vip>
The code will be token colered according to Visual Prolog rules (more or less). For example:
<vip>predicates isMember : (Elem Value, Elem* List) determ. %@short Succeds is #Value is member of #List. %@end clauses isMember(V, [V|_L]) :- !. isMember(V, [_X|L]) :- isMember(V, L).</vip>
The result will look like this:
predicates isMember : (Elem Value, Elem* List) determ. %@short Succeds is #Value is member of #List. %@end clauses isMember(V, [V|_L]) :- !. isMember(V, [_X|L]) :- isMember(V, L).
Other Languages
Other programming languages can be token colored using
<source lang="XXXX"> ... </source>
where XXXX indicates a programming (see below for supported languages).
If you for example write:
<source lang="java">/** "ConcreteImplementor" 1/2 */ class DrawingAPI1 implements DrawingAPI { public void drawCircle(double x, double y, double radius) { System.out.printf("API1.circle at %f:%f radius %f\n", x, y, radius); } }</source>
The result will be like this:
/** "ConcreteImplementor" 1/2 */ class DrawingAPI1 implements DrawingAPI { public void drawCircle(double x, double y, double radius) { System.out.printf("API1.circle at %f:%f radius %f\n", x, y, radius); } }
Supported Languages
Invalid language.
You need to specify a language like this: <source lang="html4strict">...</source>
Supported languages for syntax highlighting:
4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, aimms, algol68, apache, applescript, apt_sources, arm, asm, asp, asymptote, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, c_winapi, caddcl, cadlisp, cfdg, cfm, chaiscript, chapel, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, cpp-winapi, csharp, css, cuesheet, d, dart, dcl, dcpu16, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, ezt, f1, falcon, fo, fortran, freebasic, freeswitch, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, haxe, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, ispfpanel, j, java, java5, javascript, jcl, jquery, kixtart, klonec, klonecpp, latex, lb, ldif, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, nagios, netrexx, newlisp, nginx, nimrod, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, octave, oobas, oorexx, oracle11, oracle8, oxygene, oz, parasail, parigp, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, postscript, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, pys60, python, q, qbasic, qml, racket, rails, rbs, rebol, reg, rexx, robots, rpmspec, rsplus, ruby, rust, sas, scala, scheme, scilab, scl, sdlbasic, smalltalk, smarty, spark, sparql, sql, standardml, stonescript, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, upc, urbi, uscript, vala, vb, vbnet, vbscript, vedit, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic