welcome: please sign in
location: HelpOnParsers

HelpContents > HelpForUsers > HelpOnEditing > HelpOnParsers

Parsers

Besides the default MoinMoin wiki markup, different parsers allow the user to enter content into a page or a page section which is interpreted differently.

Additionally to the built-in parsers, you can find more of them on ParserMarket.

1. How Parsers are applied

A parser reads some portion of text, analyzes it and creates some specially formatted output from it. You can choose the parser to use using 2 different techniques:

  1. A #format processing instruction

    A #format processing instruction can be used to tell MoinMoin which parser to use for the whole page content. By default this is the wiki parser (for moin wiki markup). For details see: The #format Processing Instruction

  2. A Parser section - see HelpOnFormatting With the use of a parser section, a parser can be applied to only a part of a page. You specify which parser to call by using a shebang-like construct in the first line. A shebang is a concept known from Unix command line scripts, where they serve the exact same purpose: the first line tells the shell what program to start to process the remaining lines of the script.

1.1. Example: Processing instruction

This is the complete page contents:

#format creole
... **bold** ...

1.2. Example: Parser section

This is a part of a wiki page:

It renders as:

1.3. Parser sections and nesting

Please note that there are 2 ways to solve nesting problems related to }}}:

For more information on the possible markup, see HelpOnEditing.

2. Parsers for writing text content

Some of the parsers are intended for writing normal page text (like e.g. a document):

3. csv parser

The CSV parser works on so-called comma separated values, though the comma is now usually and by default a semicolon. The first line is considered to contain column titles that are rendered in bold, so when you don't want table headers, leave the first line empty.

The shebang can contain the following arguments:

The parser also supports the old, deprecated syntax for the shebang.

Example (please see the raw text of this page for the markup used):

MoinMoin Version Date
0.9 2001-05-07
0.8 2001-01-23
0.7 2000-12-06
0.6 2000-12-04
0.5 2000-11-17
0.4 2000-11-01
0.3 2000-10-25
0.2 2000-08-26
0.1 2000-07-29

Another example, utilizes link option to have links in some column:

{{{#!csv delimiter=, link=Server quotechar="
Type,Server
wiki,http://moinmo.in MoinMoin
translation,http://master19.moinmo.in master19
}}}

It renders as:

Type Server
wiki MoinMoin
translation master19

4. diff, cplusplus, python, java, pascal, irc/irssi parsers

These parsers were provided with MoinMoin versions < 1.9 using a moin-specific parsing / syntax highlighting implementation. Since MoinMoin 1.9 these parsers are just shortcuts, calling the highlight parser (see below).

5. highlight parser

MoinMoin comes with a special parser called highlight that uses Pygments internally.

You can use it to highlight many sorts of programming source code, configuration files and other sorts of text files used on computers (just use the corresponding Lexer name from the table below).

Usage:

renders as:

(!) Of course you can also use it for a complete page as a processing instruction, e.g.: #format highlight python

5.1. Arguments

The highlight parser accepts arguments for line numbering:

Usage:

renders as:

class FooBar:
   """ doc string """

5.2. Available highlight lexers

Use value in "Lexer names" column as argument for the highlight parser:

Lexer description Lexer names File patterns Mimetypes
ABAP abap *.abap text/x-abap
ActionScript as, actionscript *.as application/x-actionscript, text/x-actionscript, text/actionscript
ActionScript 3 as3, actionscript3 *.as application/x-actionscript, text/x-actionscript, text/actionscript
ANTLR antlr
ANTLR With ActionScript Target antlr-as, antlr-actionscript *.G, *.g
ANTLR With C# Target antlr-csharp, antlr-c# *.G, *.g
ANTLR With CPP Target antlr-cpp *.G, *.g
ANTLR With Java Target antlr-java *.G, *.g
ANTLR With ObjectiveC Target antlr-objc *.G, *.g
ANTLR With Perl Target antlr-perl *.G, *.g
ANTLR With Python Target antlr-python *.G, *.g
ANTLR With Ruby Target antlr-ruby, antlr-rb *.G, *.g
ApacheConf apacheconf, aconf, apache .htaccess, apache.conf, apache2.conf text/x-apacheconf
AppleScript applescript *.applescript
aspx-cs aspx-cs *.aspx, *.asax, *.ascx, *.ashx, *.asmx, *.axd
aspx-vb aspx-vb *.aspx, *.asax, *.ascx, *.ashx, *.asmx, *.axd
Asymptote asy *.asy text/x-asymptote
Bash bash, sh *.sh, *.ebuild, *.eclass application/x-sh, application/x-shellscript
Bash Session console *.sh-session application/x-shell-session
Batchfile bat *.bat, *.cmd application/x-dos-batch
BBCode bbcode text/x-bbcode
Befunge befunge *.befunge application/x-befunge
Boo boo *.boo text/x-boo
Brainfuck brainfuck, bf *.bf, *.b application/x-brainfuck
C c *.c, *.h text/x-chdr, text/x-csrc
C# csharp, c# *.cs text/x-csharp
C++ cpp, c++ *.cpp, *.hpp, *.c++, *.h++, *.cc, *.hh, *.cxx, *.hxx text/x-c++hdr, text/x-c++src
c-objdump c-objdump *.c-objdump text/x-c-objdump
Cheetah cheetah, spitfire *.tmpl, *.spt application/x-cheetah, application/x-spitfire
Clojure clojure, clj *.clj text/x-clojure, application/x-clojure
CMake cmake *.cmake text/x-cmake
Common Lisp common-lisp, cl *.cl, *.lisp, *.el text/x-common-lisp
cpp-objdump cpp-objdump, c++-objdumb, cxx-objdump *.cpp-objdump, *.c++-objdump, *.cxx-objdump text/x-cpp-objdump
CSS css *.css text/css
CSS+Django/Jinja css+django, css+jinja text/css+django, text/css+jinja
CSS+Genshi Text css+genshitext, css+genshi text/css+genshi
CSS+Mako css+mako text/css+mako
CSS+Myghty css+myghty text/css+myghty
CSS+PHP css+php text/css+php
CSS+Ruby css+erb, css+ruby text/css+ruby
CSS+Smarty css+smarty text/css+smarty
Cython cython, pyx *.pyx, *.pxd, *.pxi text/x-cython, application/x-cython
D d *.d, *.di text/x-dsrc
d-objdump d-objdump *.d-objdump text/x-d-objdump
Darcs Patch dpatch *.dpatch, *.darcspatch
Debian Control file control control
Debian Sourcelist sourceslist, sources.list sources.list
Delphi delphi, pas, pascal, objectpascal *.pas text/x-pascal
Diff diff, udiff *.diff, *.patch text/x-diff, text/x-patch
Django/Jinja django, jinja application/x-django-templating, application/x-jinja
Dylan dylan *.dylan text/x-dylan
Embedded Ragel ragel-em *.rl
ERB erb application/x-ruby-templating
Erlang erlang *.erl, *.hrl text/x-erlang
Erlang erl session erl *.erl-sh text/x-erl-shellsession
Evoque evoque *.evoque application/x-evoque
Fortran fortran *.f, *.f90 text/x-fortran
GAS gas *.s, *.S text/x-gas
Genshi genshi, kid, xml+genshi, xml+kid *.kid application/x-genshi, application/x-kid
Genshi Text genshitext application/x-genshi-text, text/x-genshi
Gettext Catalog pot, po *.pot, *.po application/x-gettext, text/x-gettext, text/gettext
Gherkin Cucumber, cucumber, Gherkin, gherkin *.feature text/x-gherkin
GLSL glsl *.vert, *.frag, *.geo text/x-glslsrc
Gnuplot gnuplot *.plot, *.plt text/x-gnuplot
Go go *.go text/x-gosrc
Groff groff, nroff, man *.[1234567], *.man application/x-troff, text/troff
Haskell haskell, hs *.hs text/x-haskell
HTML html *.html, *.htm, *.xhtml, *.xslt text/html, application/xhtml+xml
HTML+Cheetah html+cheetah, html+spitfire text/html+cheetah, text/html+spitfire
HTML+Django/Jinja html+django, html+jinja text/html+django, text/html+jinja
HTML+Evoque html+evoque *.html text/html+evoque
HTML+Genshi html+genshi, html+kid text/html+genshi
HTML+Mako html+mako text/html+mako
HTML+Myghty html+myghty text/html+myghty
HTML+PHP html+php *.phtml application/x-php, application/x-httpd-php, application/x-httpd-php3, application/x-httpd-php4, application/x-httpd-php5
HTML+Smarty html+smarty text/html+smarty
INI ini, cfg *.ini, *.cfg, *.properties text/x-ini
Io io *.io text/x-iosrc
IRC logs irc *.weechatlog text/x-irclog
Java java *.java text/x-java
Java Server Page jsp *.jsp application/x-jsp
JavaScript js, javascript *.js application/x-javascript, text/x-javascript, text/javascript
JavaScript+Cheetah js+cheetah, javascript+cheetah, js+spitfire, javascript+spitfire application/x-javascript+cheetah, text/x-javascript+cheetah, text/javascript+cheetah, application/x-javascript+spitfire, text/x-javascript+spitfire, text/javascript+spitfire
JavaScript+Django/Jinja js+django, javascript+django, js+jinja, javascript+jinja application/x-javascript+django, application/x-javascript+jinja, text/x-javascript+django, text/x-javascript+jinja, text/javascript+django, text/javascript+jinja
JavaScript+Genshi Text js+genshitext, js+genshi, javascript+genshitext, javascript+genshi application/x-javascript+genshi, text/x-javascript+genshi, text/javascript+genshi
JavaScript+Mako js+mako, javascript+mako application/x-javascript+mako, text/x-javascript+mako, text/javascript+mako
JavaScript+Myghty js+myghty, javascript+myghty application/x-javascript+myghty, text/x-javascript+myghty, text/javascript+mygthy
JavaScript+PHP js+php, javascript+php application/x-javascript+php, text/x-javascript+php, text/javascript+php
JavaScript+Ruby js+erb, javascript+erb, js+ruby, javascript+ruby application/x-javascript+ruby, text/x-javascript+ruby, text/javascript+ruby
JavaScript+Smarty js+smarty, javascript+smarty application/x-javascript+smarty, text/x-javascript+smarty, text/javascript+smarty
Lighttpd configuration file lighty, lighttpd text/x-lighttpd-conf
Literate Haskell lhs, literate-haskell *.lhs text/x-literate-haskell
LLVM llvm *.ll text/x-llvm
Logtalk logtalk *.lgt text/x-logtalk
Lua lua *.lua text/x-lua, application/x-lua
Makefile basemake
Makefile make, makefile, mf, bsdmake *.mak, Makefile, makefile, Makefile.*, GNUmakefile text/x-makefile
Mako mako *.mao application/x-mako
Matlab matlab, octave *.m text/matlab
Matlab session matlabsession
MiniD minid *.md text/x-minidsrc
Modelica modelica *.mo text/x-modelica
MoinMoin/Trac Wiki markup trac-wiki, moin text/x-trac-wiki
MOOCode moocode *.moo text/x-moocode
MuPAD mupad *.mu
MXML mxml *.mxml
Myghty myghty *.myt, autodelegate application/x-myghty
MySQL mysql text/x-mysql
NASM nasm *.asm, *.ASM text/x-nasm
Newspeak newspeak *.ns2 text/x-newspeak
Nginx configuration file nginx text/x-nginx-conf
NumPy numpy
objdump objdump *.objdump text/x-objdump
Objective-C objective-c, objectivec, obj-c, objc *.m text/x-objective-c
OCaml ocaml *.ml, *.mli, *.mll, *.mly text/x-ocaml
Ooc ooc *.ooc text/x-ooc
Perl perl, pl *.pl, *.pm text/x-perl, application/x-perl
PHP php, php3, php4, php5 *.php, *.php[345] text/x-php
POVRay pov *.pov, *.inc text/x-povray
Prolog prolog *.prolog, *.pro, *.pl text/x-prolog
Python python, py *.py, *.pyw, *.sc, SConstruct, SConscript text/x-python, application/x-python
Python 3 python3, py3 text/x-python3, application/x-python3
Python 3.0 Traceback py3tb *.py3tb text/x-python3-traceback
Python console session pycon text/x-python-doctest
Python Traceback pytb *.pytb text/x-python-traceback
Ragel ragel
Ragel in C Host ragel-c *.rl
Ragel in CPP Host ragel-cpp *.rl
Ragel in D Host ragel-d *.rl
Ragel in Java Host ragel-java *.rl
Ragel in Objective C Host ragel-objc *.rl
Ragel in Ruby Host ragel-ruby, ragel-rb *.rl
Raw token data raw application/x-pygments-tokens
REBOL rebol *.r, *.r3 text/x-rebol
Redcode redcode *.cw
reStructuredText rst, rest, restructuredtext *.rst, *.rest text/x-rst, text/prs.fallenstein.rst
RHTML rhtml, html+erb, html+ruby *.rhtml text/html+ruby
Ruby rb, ruby *.rb, *.rbw, Rakefile, *.rake, *.gemspec, *.rbx text/x-ruby, application/x-ruby
Ruby irb session rbcon, irb text/x-ruby-shellsession
S splus, s, r *.S, *.R text/S-plus, text/S, text/R
Scala scala *.scala text/x-scala
Scheme scheme, scm *.scm text/x-scheme, application/x-scheme
Smalltalk smalltalk, squeak *.st text/x-smalltalk
Smarty smarty *.tpl application/x-smarty
SQL sql *.sql text/x-sql
sqlite3con sqlite3 *.sqlite3-console text/x-sqlite3-console
SquidConf squidconf, squid.conf, squid squid.conf text/x-squidconf
Tcl tcl *.tcl text/x-tcl, text/x-script.tcl, application/x-tcl
Tcsh tcsh, csh *.tcsh, *.csh application/x-csh
TeX tex, latex *.tex, *.aux, *.toc text/x-tex, text/x-latex
Text only text *.txt text/plain
Vala vala, vapi *.vala, *.vapi text/x-vala
VB.net vb.net, vbnet *.vb, *.bas text/x-vbnet, text/x-vba
VimL vim *.vim, .vimrc text/x-vim
XML xml *.xml, *.xsl, *.rss, *.xslt, *.xsd, *.wsdl text/xml, application/xml, image/svg+xml, application/rss+xml, application/atom+xml, application/xsl+xml, application/xslt+xml
XML+Cheetah xml+cheetah, xml+spitfire application/xml+cheetah, application/xml+spitfire
XML+Django/Jinja xml+django, xml+jinja application/xml+django, application/xml+jinja
XML+Evoque xml+evoque *.xml application/xml+evoque
XML+Mako xml+mako application/xml+mako
XML+Myghty xml+myghty application/xml+myghty
XML+PHP xml+php application/xml+php
XML+Ruby xml+erb, xml+ruby application/xml+ruby
XML+Smarty xml+smarty application/xml+smarty
XSLT xslt *.xsl, *.xslt text/xml, application/xml, image/svg+xml, application/rss+xml, application/atom+xml, application/xsl+xml, application/xslt+xml
YAML yaml *.yaml, *.yml text/x-yaml