MediaCloth

About

See also RubyForge MediaCloth page

MediaCloth is the first MediaWiki parser written in Ruby. MediaCloth is also the first true MediaWiki parser which has handwritten lexer, LALR parser, AST builder, walker and HTML generator.

MediaCloth is still in the early stages in development but it already has some capabilities working.

For example, the text

This is some text with '''bold''' and ''italic'' formating.
The list is also here:
* List Item 1
** Sub list item 1
** Sub list item 2
* List Item 2
The end
----
will be transformed by MediaCloth parser and HTML generator into:

This is some text with bold and italic formating. The list is also here: The end

Download

MediaCloth 0.0.1
This release is available as gem package:

gem install mediacloth
Look through our download page for more files.

It's also possible to download it from SVN directly and try:
Get recent SVN snapshot
Anonymous SVN instructions

API

The MediaCloth API is extremely simple. If you have a mediawiki-formatted input string, all you need to do is:
            require 'mediacloth'
            puts MediaCloth::wiki_to_html(input)
This is equivalent for
            require 'mediacloth'

            parser = MediaWikiParser.new
            parser.lexer = MediaWikiLexer.new
            ast = parser.parse(input)
            generator = MediaWikiHTMLGenerator.new
            generator.parse(ast)
            puts generator.html

Look into the complete API reference for more information

Mailinglists and Support

Users List
Developers List