UpdateWiki:

HilfeInhalt > HilfeFürBenutzer > HilfeZumEditieren > HilfeZuParsern

Parser

Neben der voreingestellten MoinMoin-Wiki-Auszeichnungssprache (Markup), erlauben verschiedene Parser (Syntaxanalysatoren) dem Benutzer, Inhalt in eine Seite oder einen Bereich einer Seite einzufügen, der anders interpretiert wird.

Zusätzlich zu den mitgelieferten Parsern finden Sie weitere unter MoinMoin:ParserMarket..

Wie Parser angewendet werden

Parser lesen einen Teil des Textes, analysieren ihn und erzeugen daraus einige speziell formatierte Ausgaben. Sie können bei Parsern zwischen zwei verschiedenen Techniken wählen:

  1. Die #format-Verarbeitungsanweisung

    • Eine #format-Verarbeitungsanweisung kann genutzt werden, um MoinMoin mitzuteilen, welchen Parser es für den gesamte Seiteninhalt verwenden soll. Voreingestellt ist der wiki-Parser (für Moin Wiki Markup). Für Details siehe: Die #format Verarbeitungsanweisung

  2. Einen Parser-Bereich - siehe HilfeZumFormatieren

    • Mit der Nutzung von Parser-Bereichen, kann ein Parser auf lediglich einen Teil einer Seite angewendet werden. Sie geben an, welchen Parser Sie aufrufen, in dem Sie eine Shebang-ähnliche Konstruktion in der ersten Zeile nutzen. Ein Shebang in Shell-Skripten dient genau dem selben Zweck: Die erste Zeile teilt der Shell mit, welches Programm gestartet werden soll, um die verbleibenden Zeilen des Skriptes zu verarbeiten.

Beispiel: Verarbeitungsanweisung

Dies ist der komplette Seiteninhalt:

#format creole
... **fett** ...

Beispiel: Parser-Bereich

Dies ist ein Teil einer Wiki-Seite:

{{{#!csv ,
a,b,c
d,e,f
}}}

Es wird so dargestellt:

Parser-Bereiche und Verschachtelung

Bitte beachten Sie, dass es zwei Methoden gibt, Verschachtelungs-Probleme mit }}} zu lösen:

Für weitere Informationen zum Editieren von Seiten lesen Sie bitte HilfeZumEditieren.

Parser, um Textinhalte zu schreiben

Einige Parser sind dazu gedacht, normale Seiteninhalte zu schreiben (wie z.B. ein Dokument):

CSV

Der CSV-Parser verarbeitet sogenannte kommaseparierte Werte - das "Komma" ist allerdings mittlerweile meist ein Semikolon und auch so voreingestellt.

Die erste Zeile enthält erwartungsgemäß Spaltentitel, die in fett dargestellt werden. Wenn Sie also keine Tabellen-Köpfe haben wollen, lassen Sie die erste Zeile frei.

Der Shebang kann folgende Argumente enthalten:

Der Parser unterstützt auch die alte, nicht empfohlene Syntax für den Shebang.

Beispiel-Tabellen (bitte betrachten Sie die Rohform der Seite, um das verwendete Markup zu sehen):

MoinMoin 1.3 - clipping der Patch History:

patch-366 make _normalize_text public method Nir Soffer
patch-367 fixed failing test wikiutil: good system page names Nir Soffer
patch-368 Fixed DeprecationWarning in RandomPage.py and an unused import in twistedmoin.py Alexander Schremmer
patch-369 remove duplicate code in formatter.base Thomas Waldmann
patch-370 fixed long int in mig3 Thomas Waldmann
patch-371 fixed unicode error on eventlog Nir Soffer
patch-372 fixed util.web.makeQueryString and Page.url Nir Soffer
patch-373 fixed again non ascii http_referer Nir Soffer
patch-374 CSV.py supports different separators now Alexander Schremmer
patch-375 improved searchform behavior on Mozilla/Firefox Nir Soffer
patch-376 More correct script for actions menu init Nir Soffer

MoinMoin Version History:

Version Date
0.11 2002-03-11
0.10 2001-10-28
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

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

Diese Parser wurden von MoinMoin-Versionen < 1.9 verwendet und waren eine moin-spezische Parser-Implementierung für Syntax-Hervorhebung. Seit MoinMoin 1.9 sind diese Parser nur noch Abkürzungen, um den highlight-Parser aufzurufen.

Der highlight-Parser

MoinMoin kommt mit einem speziellen highlight-Parser, der intern auf Pygments basiert.

Sie können ihn verwenden, um viele verschiedene Arten von Programm-Quelltext, Konfigurationsdateien und andere Textdateien hervorzuheben, die auf ihrem Computer benutzt werden.

Nutzung:

Wird dargestellt als:

(!) Natürlich können Sie es auch für eine ganze Seite verwenden mit der #format highlight ... Verarbeitungsanweisung.

Verfügbare highlight-Lexer

Verwenden Sie den Lexer-Namen als Argument für den highlight-Parser:

Lexer-Beschreibung Lexer-Namen Datei-Typen MIME-Typen
ABAP abap *.abap text/x-abap
ActionScript as, actionscript *.as application/x-actionscript3, text/x-actionscript3, text/actionscript3
ActionScript 3 as3, actionscript3 *.as application/x-actionscript, text/x-actionscript, text/actionscript
Ada ada, ada95ada2005 *.adb, *.ads, *.ada text/x-ada
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
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
autohotkey ahk *.ahk, *.ahkl text/x-autohotkey
AutoIt autoit, Autoit *.au3 text/x-autoit
Awk awk, gawk, mawk, nawk *.awk application/x-awk
Base Makefile basemake
Bash bash, sh, ksh *.sh, *.ksh, *.bash, *.ebuild, *.eclass, .bashrc, bashrc, .bash_*, bash_* 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
BlitzMax blitzmax, bmax *.bmx text/x-bmx
Boo boo *.boo text/x-boo
Brainfuck brainfuck, bf *.bf, *.b application/x-brainfuck
Bro bro *.bro
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 ca65 *.s
CBM BASIC V2 cbmbas *.bas
Ceylon ceylon *.ceylon text/x-ceylon
CFEngine3 cfengine3, cf3 *.cf
cfstatement cfs
Cheetah cheetah, spitfire *.tmpl, *.spt application/x-cheetah, application/x-spitfire
Clojure clojure, clj *.clj text/x-clojure, application/x-clojure
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 text/coffeescript
Coldfusion HTML cfm *.cfm, *.cfml, *.cfc application/x-coldfusion
Common Lisp common-lisp, cl *.cl, *.lisp, *.el text/x-common-lisp
Coq coq *.v text/x-coq
cpp-objdump cpp-objdump, c++-objdumb, cxx-objdump *.cpp-objdump, *.c++-objdump, *.cxx-objdump text/x-cpp-objdump
Croc croc *.croc text/x-crocsrc
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+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
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
Dart dart *.dart text/x-dart
Debian Control file control control
Debian Sourcelist sourceslist, sources.list sources.list
Delphi delphi, pas, pascal, objectpascal *.pas 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, application/x-jinja
DTD dtd *.dtd application/xml-dtd
Duel duel, Duel Engine, Duel View, JBST, jbst, JsonML+BST *.duel, *.jbst text/x-duel, text/x-jbst
Dylan dylan *.dylan, *.dyl, *.intr text/x-dylan
Dylan session dylan-console, dylan-repl *.dylan-console text/x-dylan-console
DylanLID dylan-lid, lid *.lid, *.hdp text/x-dylan-lid
eC ec *.ec, *.eh text/x-echdr, text/x-ecsrc
ECL ecl *.ecl application/x-ecl
Elixir elixir, ex, exs *.ex, *.exs text/x-elixir
Elixir iex session iex text/x-elixir-shellsession
Embedded Ragel ragel-em *.rl
ERB erb application/x-ruby-templating
Erlang erlang *.erl, *.hrl, *.es, *.escript text/x-erlang
Erlang erl session erl *.erl-sh text/x-erl-shellsession
Evoque evoque *.evoque application/x-evoque
Factor factor *.factor text/x-factor
Fancy fancy, fy *.fy, *.fancypack text/x-fancysrc
Fantom fan *.fan application/x-fantom
Felix felix, flx *.flx, *.flxh text/x-felix
Fortran fortran *.f, *.f90, *.F, *.F90 text/x-fortran
FoxPro Clipper, XBase *.PRG, *.prg
FSharp fsharp *.fs, *.fsi text/x-fsharp
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
GoodData-CL gooddata-cl *.gdc text/x-gooddata-cl
Gosu gosu *.gs, *.gsx, *.gsp, *.vark text/x-gosu
Gosu Template gst *.gst text/x-gosu-template
Groff groff, nroff, man *.[1234567], *.man application/x-troff, text/troff
Groovy groovy *.groovy text/x-groovy
Haml haml, HAML *.haml text/x-haml
Haskell haskell, hs *.hs text/x-haskell
haXe hx, haXe *.hx text/haxe
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+Lasso html+lasso text/html+lasso, application/x-httpd-lasso, application/x-httpd-lasso[89]
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
HTML+Velocity html+velocity text/html+velocity
HTTP http
Hxml haxeml, hxml *.hxml
Hybris hybris, hy *.hy, *.hyb text/x-hybris, application/x-hybris
IDL idl *.pro text/idl
INI ini, cfg *.ini, *.cfg text/x-ini
Io io *.io text/x-iosrc
Ioke ioke, ik *.ik text/x-iokesrc
IRC logs irc *.weechatlog text/x-irclog
Jade jade, JADE *.jade text/x-jade
JAGS jags *.jag, *.bug
Java java *.java text/x-java
Java Server Page jsp *.jsp application/x-jsp
JavaScript js, javascript *.js application/javascript, 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+Lasso js+lasso, javascript+lasso application/x-javascript+lasso, text/x-javascript+lasso, text/javascript+lasso
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
JSON json *.json application/json
Julia julia, jl *.jl text/x-julia, application/x-julia
Julia console jlcon
Kconfig kconfig, menuconfig, linux-config, kernel-config Kconfig, *Config.in*, external.in*, standard-modules.in text/x-kconfig
Koka koka *.kk, *.kki text/x-koka
Kotlin kotlin *.kt text/x-kotlin
Lasso lasso, lassoscript *.lasso, *.lasso[89] text/x-lasso
Lighttpd configuration file lighty, lighttpd text/x-lighttpd-conf
Literate Haskell lhs, literate-haskell *.lhs text/x-literate-haskell
LiveScript live-script, livescript *.ls text/livescript
LLVM llvm *.ll text/x-llvm
Logos logos *.x, *.xi, *.xm, *.xmi text/x-logos
Logtalk logtalk *.lgt text/x-logtalk
Lua lua *.lua, *.wlua text/x-lua, application/x-lua
Makefile make, makefile, mf, bsdmake *.mak, Makefile, makefile, Makefile.*, GNUmakefile text/x-makefile
Mako mako *.mao application/x-mako
MAQL maql *.maql text/x-gooddata-maql, application/x-gooddata-maql
Mason mason *.m, *.mhtml, *.mc, *.mi, autohandler, dhandler application/x-mason
Matlab matlab *.m text/matlab
Matlab session matlabsession
MiniD minid *.md text/x-minidsrc
Modelica modelica *.mo text/x-modelica
Modula-2 modula2, m2 *.def, *.mod text/x-modula2
MoinMoin/Trac Wiki markup trac-wiki, moin text/x-trac-wiki
Monkey monkey *.monkey text/x-monkey
MOOCode moocode *.moo text/x-moocode
MoonScript moon, moonscript *.moon text/x-moonscript, application/x-moonscript
Mscgen mscgen, msc *.msc
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
Nemerle nemerle *.n text/x-nemerle
NewLisp newlisp *.lsp, *.nl text/x-newlisp, application/x-newlisp
Newspeak newspeak *.ns2 text/x-newspeak
Nginx configuration file nginx text/x-nginx-conf
Nimrod nimrod, nim *.nim, *.nimrod text/x-nimrod
NSIS nsis, nsi, nsh *.nsi, *.nsh text/x-nsis
NumPy numpy
objdump objdump *.objdump text/x-objdump
Objective-C objective-c, objectivec, obj-c, objc *.m, *.h text/x-objective-c
Objective-C++ objective-c++, objectivec++, obj-c++, objc++ *.mm, *.hh text/x-objective-c++
Objective-J objective-j, objectivej, obj-j, objj *.j text/x-objective-j
OCaml ocaml *.ml, *.mli, *.mll, *.mly text/x-ocaml
Octave octave *.m text/octave
Ooc ooc *.ooc text/x-ooc
Opa opa *.opa text/x-opa
OpenEdge ABL openedge, abl, progress *.p, *.cls text/x-openedge, application/x-openedge
Perl perl, pl *.pl, *.pm text/x-perl, application/x-perl
PHP php, php3, php4, php5 *.php, *.php[345], *.inc text/x-php
PL/pgSQL plpgsql text/x-plpgsql
PostgreSQL console (psql) psql, postgresql-console, postgres-console text/x-postgresql-psql
PostgreSQL SQL dialect postgresql, postgres text/x-postgresql
PostScript postscript *.ps, *.eps application/postscript
POVRay pov *.pov, *.inc text/x-povray
PowerShell powershell, posh, ps1 *.ps1 text/x-powershell
Prolog prolog *.prolog, *.pro, *.pl text/x-prolog
Properties properties *.properties text/x-java-properties
Protocol Buffer protobuf *.proto
Puppet puppet *.pp
PyPy Log pypylog, pypy *.pypylog application/x-pypylog
Python python, py, sage *.py, *.pyw, *.sc, SConstruct, SConscript, *.tac, *.sage 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
QML qml, Qt Meta Language, Qt modeling Language *.qml application/x-qml
Racket racket, rkt *.rkt, *.rktl text/x-racket, application/x-racket
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
RConsole rconsole, rout *.Rout
Rd rd *.Rd text/x-r-doc
REBOL rebol *.r, *.r3 text/x-rebol
Redcode redcode *.cw
reg registry *.reg text/x-windows-registry
reStructuredText rst, rest, restructuredtext *.rst, *.rest text/x-rst, text/prs.fallenstein.rst
RHTML rhtml, html+erb, html+ruby *.rhtml text/html+ruby
RobotFramework RobotFramework, robotframework *.txt, *.robot text/x-robotframework
RPMSpec spec *.spec text/x-rpm-spec
Ruby rb, ruby, duby *.rb, *.rbw, Rakefile, *.rake, *.gemspec, *.rbx, *.duby text/x-ruby, application/x-ruby
Ruby irb session rbcon, irb text/x-ruby-shellsession
Rust rust *.rs, *.rc text/x-rustsrc
S splus, s, r *.S, *.R, .Rhistory, .Rprofile text/S-plus, text/S, text/x-r-source, text/x-r, text/x-R, text/x-r-history, text/x-r-profile
Sass sass, SASS *.sass text/x-sass
Scala scala *.scala text/x-scala
Scalate Server Page ssp *.ssp application/x-ssp
Scaml scaml, SCAML *.scaml text/x-scaml
Scheme scheme, scm *.scm, *.ss text/x-scheme, application/x-scheme
Scilab scilab *.sci, *.sce, *.tst text/scilab
SCSS scss *.scss text/x-scss
Shell Session shell-session *.shell-session application/x-sh-session
Smali smali *.smali text/smali
Smalltalk smalltalk, squeak *.st text/x-smalltalk
Smarty smarty *.tpl application/x-smarty
Snobol snobol *.snobol text/x-snobol
SourcePawn sp *.sp text/x-sourcepawn
SQL sql *.sql text/x-sql
sqlite3con sqlite3 *.sqlite3-console text/x-sqlite3-console
SquidConf squidconf, squid.conf, squid squid.conf text/x-squidconf
Stan stan *.stan
Standard ML sml *.sml, *.sig, *.fun text/x-standardml, application/x-standardml
systemverilog systemverilog, sv *.sv, *.svh text/x-systemverilog
Tcl tcl *.tcl text/x-tcl, text/x-script.tcl, application/x-tcl
Tcsh tcsh, csh *.tcsh, *.csh application/x-csh
Tea tea *.tea text/x-tea
TeX tex, latex *.tex, *.aux, *.toc text/x-tex, text/x-latex
Text only text *.txt text/plain
Treetop treetop *.treetop, *.tt
TypeScript ts *.ts text/x-typescript
UrbiScript urbiscript *.u application/x-urbiscript
Vala vala, vapi *.vala, *.vapi text/x-vala
VB.net vb.net, vbnet *.vb, *.bas text/x-vbnet, text/x-vba
Velocity velocity *.vm, *.fhtml
verilog verilog, v *.v text/x-verilog
VGL vgl *.rpf
vhdl vhdl *.vhdl, *.vhd text/x-vhdl
VimL vim *.vim, .vimrc, .exrc, .gvimrc, _vimrc, _exrc, _gvimrc, vimrc, gvimrc text/x-vim
XML xml *.xml, *.xsl, *.rss, *.xslt, *.xsd, *.wsdl text/xml, application/xml, image/svg+xml, application/rss+xml, application/atom+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+Lasso xml+lasso application/xml+lasso
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
XML+Velocity xml+velocity application/xml+velocity
XQuery xquery, xqy, xq, xql, xqm *.xqy, *.xquery, *.xq, *.xql, *.xqm text/xquery, application/xquery
XSLT xslt *.xsl, *.xslt, *.xpl application/xsl+xml, application/xslt+xml
Xtend xtend *.xtend text/x-xtend
YAML yaml *.yaml, *.yml text/x-yaml