| Path: | README |
| Last Update: | Fri Jul 21 13:08:22 EEST 2006 |
MediaCloth is the first MediaWiki parser and html generator written in ruby. It’s small, fast and aims to recognize the complete MediaWiki language.
To install the library run:
ruby setup.rb
The quickest way to parse your input and produce html formatted text is:
require 'mediacloth'
puts MediaCloth::wiki_to_html("'''Hello'''''World''!")
Alternatively, it’s possible to create and use each component of MediaCloth manually:
require 'mediacloth'
parser = MediaWikiParser.new
parser.lexer = MediaWikiLexer.new
ast = parser.parse("'''Hello'''''World''!")
walker = MediaWikiHTMLGenerator.new
walker.parse(ast)
puts walker.html
This is useful if you want to use another generator.
Both examples should produce
<b>Hello</b><i>World</i>!
To generate API documentation run:
rake rdoc
If you want to modify mediacloth sources you will need:
To run tests execute
rake test