Class: Vita::Format::Markdown
- Inherits:
-
Object
- Object
- Vita::Format::Markdown
- Includes:
- Singleton
- Defined in:
- lib/vita/format/markdown.rb
Instance Method Summary collapse
-
#initialize ⇒ Markdown
constructor
A new instance of Markdown.
- #name ⇒ Object
- #to_html(source) ⇒ Object
Constructor Details
#initialize ⇒ Markdown
Returns a new instance of Markdown.
8 9 10 11 12 13 14 15 16 |
# File 'lib/vita/format/markdown.rb', line 8 def initialize @markdown = Redcarpet::Markdown.new( Redcarpet::Render::HTML, fenced_code_blocks: true, highlight: true, space_after_headers: true, strikethrough: true ) end |
Instance Method Details
#name ⇒ Object
18 19 20 |
# File 'lib/vita/format/markdown.rb', line 18 def name "markdown" end |
#to_html(source) ⇒ Object
22 23 24 |
# File 'lib/vita/format/markdown.rb', line 22 def to_html(source) @markdown.render(source) end |