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.

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.

Example: Processing instruction

This is the complete page contents:

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

Example: Parser section

This is a part of a wiki page:

It renders as:

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.

Parsers for writing text content

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

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

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).

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

Arguments

The highlight parser accepts arguments for line numbering:

Usage:

renders as:

class FooBar:
   """ doc string """

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, *.ABAP text/x-abap
ABNF abnf *.abnf text/x-abnf
ActionScript as, actionscript *.as application/x-actionscript, text/x-actionscript, text/actionscript
ActionScript 3 as3, actionscript3 *.as application/x-actionscript3, text/x-actionscript3, text/actionscript3
Ada ada, ada95, ada2005 *.adb, *.ads, *.ada text/x-ada
ADL adl *.adl, *.adls, *.adlf, *.adlx
Agda agda *.agda text/x-agda
Aheui aheui *.aheui
Alloy alloy *.als text/x-alloy
AmbientTalk at, ambienttalk, ambienttalk/2 *.at text/x-ambienttalk
Ampl ampl *.run
Angular2 ng2
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
APL apl *.apl
AppleScript applescript *.applescript
Arduino arduino *.ino text/x-arduino
AspectJ aspectj *.aj text/x-aspectj
aspx-cs aspx-cs *.aspx, *.asax, *.ascx, *.ashx, *.asmx, *.axd
aspx-vb aspx-vb *.aspx, *.asax, *.ascx, *.ashx, *.asmx, *.axd
Asymptote asy, asymptote *.asy text/x-asymptote
Augeas augeas *.aug
autohotkey ahk, autohotkey *.ahk, *.ahkl text/x-autohotkey
AutoIt autoit *.au3 text/x-autoit
Awk awk, gawk, mawk, nawk *.awk application/x-awk
Base Makefile basemake
Bash bash, sh, ksh, zsh, shell *.sh, *.ksh, *.bash, *.ebuild, *.eclass, *.exheres-0, *.exlib, *.zsh, .bashrc, bashrc, .bash_*, bash_*, zshrc, .zshrc, PKGBUILD application/x-sh, application/x-shellscript, text/x-shellscript
Bash Session console, shell-session *.sh-session, *.shell-session application/x-shell-session, application/x-sh-session
Batchfile bat, batch, dosbatch, winbatch *.bat, *.cmd application/x-dos-batch
BBC Basic bbcbasic *.bbc
BBCode bbcode text/x-bbcode
BC bc *.bc
Befunge befunge *.befunge application/x-befunge
BibTeX bib, bibtex *.bib text/x-bibtex
BlitzBasic blitzbasic, b3d, bplus *.bb, *.decls text/x-bb
BlitzMax blitzmax, bmax *.bmx text/x-bmx
BNF bnf *.bnf text/x-bnf
Boa boa *.boa
Boo boo *.boo text/x-boo
Boogie boogie *.bpl
Brainfuck brainfuck, bf *.bf, *.b application/x-brainfuck
BST bst, bst-pybtex *.bst
BUGS bugs, winbugs, openbugs *.bug
C c *.c, *.h, *.idc text/x-chdr, text/x-csrc
C# csharp, c# *.cs text/x-csharp
C++ cpp, c++ *.cpp, *.hpp, *.c++, *.h++, *.cc, *.hh, *.cxx, *.hxx, *.C, *.H, *.cp, *.CPP text/x-c++hdr, text/x-c++src
c-objdump c-objdump *.c-objdump text/x-c-objdump
ca65 assembler ca65 *.s
cADL cadl *.cadl
CAmkES camkes, idl4 *.camkes, *.idl4
Cap'n Proto capnp *.capnp
CapDL capdl *.cdl
CBM BASIC V2 cbmbas *.bas
Ceylon ceylon *.ceylon text/x-ceylon
CFEngine3 cfengine3, cf3 *.cf
cfstatement cfs
ChaiScript chai, chaiscript *.chai text/x-chaiscript, application/x-chaiscript
Chapel chapel, chpl *.chpl
Charmci charmci *.ci
Cheetah cheetah, spitfire *.tmpl, *.spt application/x-cheetah, application/x-spitfire
Cirru cirru *.cirru text/x-cirru
Clay clay *.clay text/x-clay
Clean clean *.icl, *.dcl
Clojure clojure, clj *.clj text/x-clojure, application/x-clojure
ClojureScript clojurescript, cljs *.cljs text/x-clojurescript, application/x-clojurescript
CMake cmake *.cmake, CMakeLists.txt text/x-cmake
COBOL cobol *.cob, *.COB, *.cpy, *.CPY text/x-cobol
COBOLFree cobolfree *.cbl, *.CBL
CoffeeScript coffee-script, coffeescript, coffee *.coffee text/coffeescript
Coldfusion CFC cfc *.cfc
Coldfusion HTML cfm *.cfm, *.cfml application/x-coldfusion
Common Lisp common-lisp, cl, lisp *.cl, *.lisp text/x-common-lisp
Component Pascal componentpascal, cp *.cp, *.cps text/x-component-pascal
Coq coq *.v text/x-coq
cpp-objdump cpp-objdump, c++-objdumb, cxx-objdump *.cpp-objdump, *.c++-objdump, *.cxx-objdump text/x-cpp-objdump
CPSA cpsa *.cpsa
Crmsh crmsh, pcmk *.crmsh, *.pcmk
Croc croc *.croc text/x-crocsrc
Cryptol cryptol, cry *.cry text/x-cryptol
Crystal cr, crystal *.cr text/x-crystal
Csound Document csound-document, csound-csd *.csd
Csound Orchestra csound, csound-orc *.orc, *.udo
Csound Score csound-score, csound-sco *.sco
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+Lasso css+lasso text/css+lasso
CSS+Mako css+mako text/css+mako
CSS+mozpreproc css+mozpreproc *.css.in
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
CUDA cuda, cu *.cu, *.cuh text/x-cuda
Cypher cypher *.cyp, *.cypher
Cython cython, pyx, pyrex *.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
Dart dart *.dart text/x-dart
DASM16 dasm16 *.dasm16, *.dasm text/x-dasm16
Debian Control file control, debcontrol control
Debian Sourcelist sourceslist, sources.list, debsources sources.list
Delphi delphi, pas, pascal, objectpascal *.pas, *.dpr text/x-pascal
dg dg *.dg text/x-dg
Diff diff, udiff *.diff, *.patch text/x-diff, text/x-patch
Django/Jinja django, jinja application/x-django-templating<