Alternative parsers/zh

此页面是各种替代MediaWiki解析器（即程序和项目，而不是MediaWiki本身）的链接、描述和状态报告的汇编，这些解析器能够或打算将MediaWiki的文本标记语法转换为其他内容. 其中一些目的非常狭隘，而另一些则可能是取代目前驱动MediaWiki自身的复杂代码的竞争者.

许多与此相关的项目可能已经过时，维护不足，甚至被废弃. 但为了避免重复相同的工作，收集“已经在那里”的项目似乎是明智的. In addition, although so many alternative parsers exist, almost no unofficial parser powers any wiki site, except for wikitextparser which powers the OpenTTD wiki through TrueWiki.

构建抽象语法树（AST）并提供对其访问的解析器列在#提供AST的解析器；不构建AST但提取某些信息的解析器列在#提取某些信息的解析器；其余的解析器列在#其他解析器下.



提供AST的解析器


已终止


提取某些信息的解析器


已终止


一个非解析器的转储程序
One of the common uses of alternative parsers is to dump wiki content into static form, such as HTML or PDF. Tim Starling has written a script which isn't a parser, but uses the MediaWiki internal code to dump an entire wiki to HTML, from the command-line. See Extension:DumpHTML. This has been used (years ago) to create the static dumps at https://dumps.wikimedia.org

There are also similar dumpers as part of the Kiwix project, for example mwoffliner, and you can query the RESTBase API to obtain HTML-format output with semantic information (such as tranclusions) included.



相关话题

 * If you want to convert MediaWiki documents into some other format, the above tools are useful. If you want to convert HTML documents or other formats into MediaWiki documents, you may find Wikipedia: Wikipedia: Tools/Editing tools and Manual: importing external content more useful.
 * One-pass parser
 * MediaWiki lexer and MediaWiki flexer (not parsers as such, just grammar definitions; probably superseded by/within other projects below)
 * en:Wikipedia:Text editor support includes various scripts and extensions for things like syntax highlighting for things like EMACS, Vim, and all sorts; some of these may include rudimentary parsing capabilities.
 * Here are some proof of concept rules for a subset of the Mediawiki markup: these are written in a metalanguage that treats preformatted text as source text, and everything else as comment.
 * Markup spec aims to produce a specification of MediaWiki's markup format.
 * Help:Extension:ParserFunctions is the main parser extension for MediaWiki.
 * mwparserfromhell and Parsoid's similar jsapi are useful tools for extraction and transformation tasks.
 * If no library suits your needs, you still have the option of parsing the data dumps: see meta:Data_dumps and meta:Data_dumps/Other_tools.