Greencloth is a project mainly written in Ruby, based on the GPL-3.0 license.
GreenCloth lightweight markup language (an extension to RedCloth with additions for wikis)
h1. Introduction
GreenCloth is derived from RedCloth, the defacto text to html converter for ruby.
The purpose of GreenCloth is to add a bunch of new features to RedCloth that make it more suited for wiki markup.
GreenCloth requires that RedCloth version > 4.0 is installed and that prior versions are NOT installed.
h1. Changes from RedCloth
New markup:
[riseup -> http://riseup.net]
)See SYNTAX_REFERENCE for more information.
h1. Usage
h2. Example usage
You can use greencloth like so:
bc. greencloth = GreenCloth.new(body, context_name, [:outline]) greencloth.to_html
Greencloth.new takes three argument:
h2. Passing a block to to_html()
Greencloth.to_html can take a block. The block is passed data regarding every link that it encounteres while processing links.
You can use this to do custom rendering of links. For example:
bc. html = GreenCloth.new(test_text,'mygroup').to_html() do |link_data| process_link(link_data) end
@process_link@ should return either nil or an @@ tag. If nil, then the greencloth default is used.
link_date is a hash that might include: url, label, context_name, page_name
h1. Testing
To run the all the tests:
bc. rake test
Or to test the markup from a specific fixture:
bc. ruby test/markup_test.rb test/fixtures/images.yml
h1. TODO
sometimes the header detection for editing inline fails.