Class: Bookshelf::Markdown
- Inherits:
-
Object
- Object
- Bookshelf::Markdown
- Defined in:
- lib/bookshelf/adapters/markdown.rb
Constant Summary collapse
- MARKDOWN_LIBRARIES =
Supported Markdown libraries
%w[Maruku]
Class Method Summary collapse
-
.engine ⇒ Object
Retrieve preferred Markdown processor.
-
.to_html(content) ⇒ Object
Convert Markdown to HTML.
Class Method Details
.engine ⇒ Object
Retrieve preferred Markdown processor.
7 8 9 |
# File 'lib/bookshelf/adapters/markdown.rb', line 7 def self.engine @engine ||= Object.const_get(MARKDOWN_LIBRARIES.find {|lib| Object.const_defined?(lib)}) end |
.to_html(content) ⇒ Object
Convert Markdown to HTML.
12 13 14 |
# File 'lib/bookshelf/adapters/markdown.rb', line 12 def self.to_html(content) engine.new(content).to_html end |