Ruby implementation of the MediaWiki markup language.
Ruby implementation of the MediaWiki markup language.
h1. WikiCloth "!https://api.travis-ci.org/nricciar/wikicloth.png!":https://travis-ci.org/nricciar/wikicloth
Ruby implementation of the MediaWiki markup language.
h2. Supports
For more information about the MediaWiki markup see "https://www.mediawiki.org/wiki/Markup_spec":https://www.mediawiki.org/wiki/Markup_spec
h2. Install
git clone git://github.com/nricciar/wikicloth.git cd wikicloth/ rake install
h2. Usage
@wiki = WikiCloth::Parser.new({ :data => "{{test}} ''Hello {{test}}!''\n", :params => { "test" => "World" } })
@wiki.to_html => " {{test}} Hello World! "
h2. Advanced Usage
Most features of WikiCloth can be overriden as needed...
class WikiParser url_for(page) } end
template do |template|
"Hello {{{1}}}" if template == "hello"
end
external_link do |url,text|
"#{text.blank? ? url : text}"
endend
@wiki = WikiParser.new({ :params => { "PAGENAME" => "Testing123" }, :data => "{{hello|world}} From {{ PAGENAME }} -- [www.google.com]"; })
@wiki.to_html =>
Hello world From Testing123 -- http://www.google.com
No open issues yet, or sync has not completed.