Module: TracWiki
- Defined in:
- lib/trac-wiki/parser.rb,
lib/trac-wiki.rb,
lib/trac-wiki/env.rb,
lib/trac-wiki/tree.rb,
lib/trac-wiki/version.rb
Overview
Main TracWiki parser class. Call TracWikiParser#parse to parse TracWiki formatted text.
This class is not reentrant. A separate instance is needed for each thread that needs to convert Creole to HTML.
Inherit this to provide custom handling of links. The overrideable methods are: make_local_link
Defined Under Namespace
Classes: Env, Node, Parser, RawHtml, TooLongException, Tree
Constant Summary collapse
- VERSION =
'0.3.10'
Class Method Summary collapse
- .parser(options = {}) ⇒ Object
-
.render(text, options = {}) ⇒ Object
Convert the argument in Trac format to HTML and return the result.
Class Method Details
.parser(options = {}) ⇒ Object
18 19 20 |
# File 'lib/trac-wiki.rb', line 18 def self.parser( = {}) Parser.new() end |
.render(text, options = {}) ⇒ Object
Convert the argument in Trac format to HTML and return the result. Example:
TracWiki.render(“**Hello ”World”**”) #=> “<p><strong>Hello World</strong></p>”
This is an alias for calling Creole#parse: TracWiki.new(text).to_html
15 16 17 |
# File 'lib/trac-wiki.rb', line 15 def self.render(text, = {}) Parser.new().to_html(text) end |