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.

Inhaltsverzeichnis

How Parsers are applied

Example: Processing instruction

Example: Parser section

Parser sections and nesting

Parsers for writing text content

csv parser

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

highlight parser

Arguments

Available highlight lexers

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:

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

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:

{{{#!csv ,a,b,cd,e,f}}}

It renders as:

Parser sections and nesting

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

Use more than 3 curly braces for beginning / ending of the parser section (what you use must not be contained in the section you are enclosing). E.g.:

{{{{{{{...}}}}}}}

Use 3 curly braces + some unique string:

{{{asdfghj{{{...}}}asdfghj}}}

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

wiki – the standard moin wiki parser, see HelpOnMoinWikiSyntax

creole – the creole wiki markup parser, see HelpOnCreoleSyntax

ReST (reStructuredText) – see /ReStructuredText

XML/XSLT/DocBook – see HelpOnXmlPages

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:

delimiter or separator: delimiter=, will set the delimiter to a comma

quotechar: quotechar=" will allow quoting values with a double-quote

show: comma-separated list of columns to show only

hide: comma-separated list of columns to hide

autofilter: comma-separated list of columns to add auto-filters on

name: name of the dataset

link: comma-separated list of columns consisting of http://example.com/link description text rather than just text

static_cols, static_vals: columns (and respective values) added to each record

-N (where N is a number): hide column N (useful when column names are omitted)

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

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

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

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

It renders as:

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:

{{{#!highlight pythonclass FooBar: """ doc string """}}}

renders as:

class FooBar:
""" doc string """

(!) 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:

numbers= might be on, off, or disable and defaults to on. on or off means that line numbers are switchable via JavaScript (html formatter). disabled means that line numbers are disabled completely.

start= must be a non negative number and defaults to 1,

step= must be a non negative number and defaults to 1.

Usage:

{{{#!highlight python numbers=disableclass FooBar: """ doc string """}}}

renders as:

class FooBar:
""" doc string """

Available highlight lexers

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

Lexer-Beschreibung Lexer-Namen Datei-Typen MIME-Typen ABAPabap*.abaptext/x-abapActionScriptasactionscript*.asapplication/x-actionscript3text/x-actionscript3text/actionscript3ActionScript 3as3actionscript3*.asapplication/x-actionscripttext/x-actionscripttext/actionscriptAdaadaada95ada2005*.adb*.ads*.adatext/x-adaANTLRantlrANTLR With ActionScript Targetantlr-asantlr-actionscript*.G*.gANTLR With C# Targetantlr-csharpantlr-c#*.G*.gANTLR With CPP Targetantlr-cpp*.G*.gANTLR With Java Targetantlr-java*.G*.gANTLR With ObjectiveC Targetantlr-objc*.G*.gANTLR With Perl Targetantlr-perl*.G*.gANTLR With Python Targetantlr-python*.G*.gANTLR With Ruby Targetantlr-rubyantlr-rb*.G*.gApacheConfapacheconfaconfapache.htaccessapache.confapache2.conftext/x-apacheconfAppleScriptapplescript*.applescriptaspx-csaspx-cs*.aspx*.asax*.ascx*.ashx*.asmx*.axdaspx-vbaspx-vb*.aspx*.asax*.ascx*.ashx*.asmx*.axdAsymptoteasyasymptote*.asytext/x-asymptoteautohotkeyahk*.ahk*.ahkltext/x-autohotkeyAwkawkgawkmawknawk*.awkapplication/x-awkBase MakefilebasemakeBashbashshksh*.sh*.ksh*.bash*.ebuild*.eclass.bashrcbashrc.bash_*bash_*application/x-shapplication/x-shellscriptBash Sessionconsole*.sh-sessionapplication/x-shell-sessionBatchfilebat*.bat*.cmdapplication/x-dos-batchBBCodebbcodetext/x-bbcodeBefungebefunge*.befungeapplication/x-befungeBlitzMaxblitzmaxbmax*.bmxtext/x-bmxBooboo*.bootext/x-booBrainfuckbrainfuckbf*.bf*.bapplication/x-brainfuckBrobro*.broCc*.c*.h*.idctext/x-chdrtext/x-csrcC#csharpc#*.cstext/x-csharpC++cppc++*.cpp*.hpp*.c++*.h++*.cc*.hh*.cxx*.hxxtext/x-c++hdrtext/x-c++srcc-objdumpc-objdump*.c-objdumptext/x-c-objdumpCFEngine3cfengine3cf3*.cfcfstatementcfsCheetahcheetahspitfire*.tmpl*.sptapplication/x-cheetahapplication/x-spitfireClojureclojureclj*.cljtext/x-clojureapplication/x-clojureCMakecmake*.cmakeCMakeLists.txttext/x-cmakeCoffeeScriptcoffee-scriptcoffeescript*.coffeetext/coffeescriptColdfusion HTMLcfm*.cfm*.cfml*.cfcapplication/x-coldfusionCommon Lispcommon-lispcl*.cl*.lisp*.eltext/x-common-lispCoqcoq*.vtext/x-coqcpp-objdumpcpp-objdumpc++-objdumbcxx-objdump*.cpp-objdump*.c++-objdump*.cxx-objdumptext/x-cpp-objdumpCSScss*.csstext/cssCSS+Django/Jinjacss+djangocss+jinjatext/css+djangotext/css+jinjaCSS+Genshi Textcss+genshitextcss+genshitext/css+genshiCSS+Makocss+makotext/css+makoCSS+Myghtycss+myghtytext/css+myghtyCSS+PHPcss+phptext/css+phpCSS+Rubycss+erbcss+rubytext/css+rubyCSS+Smartycss+smartytext/css+smartyCythoncythonpyx*.pyx*.pxd*.pxitext/x-cythonapplication/x-cythonDd*.d*.ditext/x-dsrcd-objdumpd-objdump*.d-objdumptext/x-d-objdumpDarcs Patchdpatch*.dpatch*.darcspatchDartdart*.darttext/x-dartDebian Control filecontrolcontrolDebian Sourcelistsourceslistsources.listsources.listDelphidelphipaspascalobjectpascal*.pastext/x-pascalDiffdiffudiff*.diff*.patchtext/x-difftext/x-patchDjango/Jinjadjangojinjaapplication/x-django-templatingapplication/x-jinjaDTDdtd*.dtdapplication/xml-dtdDuelduelDuel EngineDuel ViewJBSTjbstJsonML+BST*.duel*.jbsttext/x-dueltext/x-jbstDylandylan*.dylan*.dyltext/x-dylaneCec*.ec*.ehtext/x-echdrtext/x-ecsrcECLecl*.eclapplication/x-eclElixirelixirexexs*.ex*.exstext/x-elixirElixir iex sessioniextext/x-elixir-shellsessionEmbedded Ragelragel-em*.rlERBerbapplication/x-ruby-templatingErlangerlang*.erl*.hrl*.es*.escripttext/x-erlangErlang erl sessionerl*.erl-shtext/x-erl-shellsessionEvoqueevoque*.evoqueapplication/x-evoqueFactorfactor*.factortext/x-factorFancyfancyfy*.fy*.fancypacktext/x-fancysrcFantomfan*.fanapplication/x-fantomFelixfelixflx*.flx*.flxhtext/x-felixFortranfortran*.f*.f90*.F*.F90text/x-fortranFSharpfsharp*.fs*.fsitext/x-fsharpGASgas*.s*.Stext/x-gasGenshigenshikidxml+genshixml+kid*.kidapplication/x-genshiapplication/x-kidGenshi Textgenshitextapplication/x-genshi-texttext/x-genshiGettext Catalogpotpo*.pot*.poapplication/x-gettexttext/x-gettexttext/gettextGherkinCucumbercucumberGherkingherkin*.featuretext/x-gherkinGLSLglsl*.vert*.frag*.geotext/x-glslsrcGnuplotgnuplot*.plot*.plttext/x-gnuplotGogo*.gotext/x-gosrcGoodData-CLgooddata-cl*.gdctext/x-gooddata-clGosugosu*.gs*.gsx*.gsp*.varktext/x-gosuGosu Templategst*.gsttext/x-gosu-templateGroffgroffnroffman*.[1234567]*.manapplication/x-trofftext/troffGroovygroovy*.groovytext/x-groovyHamlhamlHAML*.hamltext/x-hamlHaskellhaskellhs*.hstext/x-haskellhaXehxhaXe*.hxtext/haxeHTMLhtml*.html*.htm*.xhtml*.xslttext/htmlapplication/xhtml+xmlHTML+Cheetahhtml+cheetahhtml+spitfiretext/html+cheetahtext/html+spitfireHTML+Django/Jinjahtml+djangohtml+jinjatext/html+djangotext/html+jinjaHTML+Evoquehtml+evoque*.htmltext/html+evoqueHTML+Genshihtml+genshihtml+kidtext/html+genshiHTML+Makohtml+makotext/html+makoHTML+Myghtyhtml+myghtytext/html+myghtyHTML+PHPhtml+php*.phtmlapplication/x-phpapplication/x-httpd-phpapplication/x-httpd-php3application/x-httpd-php4application/x-httpd-php5HTML+Smartyhtml+smartytext/html+smartyHTML+Velocityhtml+velocitytext/html+velocityHTTPhttpHybrishybrishy*.hy*.hybtext/x-hybrisapplication/x-hybrisINIinicfg*.ini*.cfgtext/x-iniIoio*.iotext/x-iosrcIokeiokeik*.iktext/x-iokesrcIRC logsirc*.weechatlogtext/x-irclogJadejadeJADE*.jadetext/x-jadeJavajava*.javatext/x-javaJava Server Pagejsp*.jspapplication/x-jspJavaScriptjsjavascript*.jsapplication/javascriptapplication/x-javascripttext/x-javascripttext/javascriptJavaScript+Cheetahjs+cheetahjavascript+cheetahjs+spitfirejavascript+spitfireapplication/x-javascript+cheetahtext/x-javascript+cheetahtext/javascript+cheetahapplication/x-javascript+spitfiretext/x-javascript+spitfiretext/javascript+spitfireJavaScript+Django/Jinjajs+djangojavascript+djangojs+jinjajavascript+jinjaapplication/x-javascript+djangoapplication/x-javascript+jinjatext/x-javascript+djangotext/x-javascript+jinjatext/javascript+djangotext/javascript+jinjaJavaScript+Genshi Textjs+genshitextjs+genshijavascript+genshitextjavascript+genshiapplication/x-javascript+genshitext/x-javascript+genshitext/javascript+genshiJavaScript+Makojs+makojavascript+makoapplication/x-javascript+makotext/x-javascript+makotext/javascript+makoJavaScript+Myghtyjs+myghtyjavascript+myghtyapplication/x-javascript+myghtytext/x-javascript+myghtytext/javascript+mygthyJavaScript+PHPjs+phpjavascript+phpapplication/x-javascript+phptext/x-javascript+phptext/javascript+phpJavaScript+Rubyjs+erbjavascript+erbjs+rubyjavascript+rubyapplication/x-javascript+rubytext/x-javascript+rubytext/javascript+rubyJavaScript+Smartyjs+smartyjavascript+smartyapplication/x-javascript+smartytext/x-javascript+smartytext/javascript+smartyJSONjson*.jsonapplication/jsonKotlinkotlin*.kttext/x-kotlinLighttpd configuration filelightylighttpdtext/x-lighttpd-confLiterate Haskelllhsliterate-haskell*.lhstext/x-literate-haskellLLVMllvm*.lltext/x-llvmLogtalklogtalk*.lgttext/x-logtalkLualua*.lua*.wluatext/x-luaapplication/x-luaMakefilemakemakefilemfbsdmake*.makMakefilemakefileMakefile.*GNUmakefiletext/x-makefileMakomako*.maoapplication/x-makoMAQLmaql*.maqltext/x-gooddata-maqlapplication/x-gooddata-maqlMasonmason*.m*.mhtml*.mc*.miautohandlerdhandlerapplication/x-masonMatlabmatlab*.mtext/matlabMatlab sessionmatlabsessionMiniDminid*.mdtext/x-minidsrcModelicamodelica*.motext/x-modelicaModula-2modula2m2*.def*.modtext/x-modula2MoinMoin/Trac Wiki markuptrac-wikimointext/x-trac-wikiMOOCodemoocode*.mootext/x-moocodeMoonScriptmoonmoonscript*.moontext/x-moonscriptapplication/x-moonscriptMuPADmupad*.muMXMLmxml*.mxmlMyghtymyghty*.mytautodelegateapplication/x-myghtyMySQLmysqltext/x-mysqlNASMnasm*.asm*.ASMtext/x-nasmNemerlenemerle*.ntext/x-nemerleNewLispnewlisp*.lsp*.nltext/x-newlispapplication/x-newlispNewspeaknewspeak*.ns2text/x-newspeakNginx configuration filenginxtext/x-nginx-confNimrodnimrodnim*.nim*.nimrodtext/x-nimrodNumPynumpyobjdumpobjdump*.objdumptext/x-objdumpObjective-Cobjective-cobjectivecobj-cobjc*.mtext/x-objective-cObjective-Jobjective-jobjectivejobj-jobjj*.jtext/x-objective-jOCamlocaml*.ml*.mli*.mll*.mlytext/x-ocamlOctaveoctave*.mtext/octaveOocooc*.ooctext/x-oocOpaopa*.opatext/x-opaOpenEdge ABLopenedgeablprogress*.p*.clstext/x-openedgeapplication/x-openedgePerlperlpl*.pl*.pmtext/x-perlapplication/x-perlPHPphpphp3php4php5*.php*.php[345]text/x-phpPL/pgSQLplpgsqltext/x-plpgsqlPostgreSQL console (psql)psqlpostgresql-consolepostgres-consoletext/x-postgresql-psqlPostgreSQL SQL dialectpostgresqlpostgrestext/x-postgresqlPostScriptpostscript*.ps*.epsapplication/postscriptPOVRaypov*.pov*.inctext/x-povrayPowerShellpowershellposhps1*.ps1text/x-powershellPrologprolog*.prolog*.pro*.pltext/x-prologPropertiesproperties*.propertiestext/x-java-propertiesProtocol Bufferprotobuf*.protoPyPy Logpypylogpypy*.pypylogapplication/x-pypylogPythonpythonpy*.py*.pyw*.scSConstructSConscript*.tactext/x-pythonapplication/x-pythonPython 3python3py3text/x-python3application/x-python3Python 3.0 Tracebackpy3tb*.py3tbtext/x-python3-tracebackPython console sessionpycontext/x-python-doctestPython Tracebackpytb*.pytbtext/x-python-tracebackRagelragelRagel in C Hostragel-c*.rlRagel in CPP Hostragel-cpp*.rlRagel in D Hostragel-d*.rlRagel in Java Hostragel-java*.rlRagel in Objective C Hostragel-objc*.rlRagel in Ruby Hostragel-rubyragel-rb*.rlRaw token datarawapplication/x-pygments-tokensRConsolerconsolerout*.RoutREBOLrebol*.r*.r3text/x-rebolRedcoderedcode*.cwreStructuredTextrstrestrestructuredtext*.rst*.resttext/x-rsttext/prs.fallenstein.rstRHTMLrhtmlhtml+erbhtml+ruby*.rhtmltext/html+rubyRubyrbrubyduby*.rb*.rbwRakefile*.rake*.gemspec*.rbx*.dubytext/x-rubyapplication/x-rubyRuby irb sessionrbconirbtext/x-ruby-shellsessionSsplussr*.S*.Rtext/S-plustext/Stext/RSasssassSASS*.sasstext/x-sassScalascala*.scalatext/x-scalaScalate Server Pagessp*.sspapplication/x-sspScamlscamlSCAML*.scamltext/x-scamlSchemeschemescm*.scm*.ss*.rkttext/x-schemeapplication/x-schemeScilabscilab*.sci*.sce*.tsttext/scilabSCSSscss*.scsstext/x-scssSmalltalksmalltalksqueak*.sttext/x-smalltalkSmartysmarty*.tplapplication/x-smartySnobolsnobol*.snoboltext/x-snobolSQLsql*.sqltext/x-sqlsqlite3consqlite3*.sqlite3-consoletext/x-sqlite3-consoleSquidConfsquidconfsquid.confsquidsquid.conftext/x-squidconfStandard MLsml*.sml*.sig*.funtext/x-standardmlapplication/x-standardmlsystemverilogsv*.sv*.svhtext/x-systemverilogTcltcl*.tcltext/x-tcltext/x-script.tclapplication/x-tclTcshtcshcsh*.tcsh*.cshapplication/x-cshTeatea*.teatext/x-teaTeXtexlatex*.tex*.aux*.toctext/x-textext/x-latexText onlytext*.txttext/plainUrbiScripturbiscript*.uapplication/x-urbiscriptValavalavapi*.vala*.vapitext/x-valaVB.netvb.netvbnet*.vb*.bastext/x-vbnettext/x-vbaVelocityvelocity*.vm*.fhtmlverilogv*.vtext/x-verilogvhdlvhdl*.vhdl*.vhdtext/x-vhdlVimLvim*.vim.vimrc.exrc.gvimrc_vimrc_exrc_gvimrcvimrcgvimrctext/x-vimXMLxml*.xml*.xsl*.rss*.xslt*.xsd*.wsdltext/xmlapplication/xmlimage/svg+xmlapplication/rss+xmlapplication/atom+xmlXML+Cheetahxml+cheetahxml+spitfireapplication/xml+cheetahapplication/xml+spitfireXML+Django/Jinjaxml+djangoxml+jinjaapplication/xml+djangoapplication/xml+jinjaXML+Evoquexml+evoque*.xmlapplication/xml+evoqueXML+Makoxml+makoapplication/xml+makoXML+Myghtyxml+myghtyapplication/xml+myghtyXML+PHPxml+phpapplication/xml+phpXML+Rubyxml+erbxml+rubyapplication/xml+rubyXML+Smartyxml+smartyapplication/xml+smartyXML+Velocityxml+velocityapplication/xml+velocityXQueryxqueryxqy*.xqy*.xquerytext/xqueryapplication/xqueryXSLTxslt*.xsl*.xsltapplication/xsl+xmlapplication/xslt+xmlYAMLyaml*.yaml*.ymltext/x-yaml