Class: Frontman::MarkdownRenderer

Inherits:
Renderer
  • Object
show all
Defined in:
lib/frontman/renderers/markdown_renderer.rb

Instance Method Summary collapse

Methods inherited from Renderer

#render

Instance Method Details

#compile(layout) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/frontman/renderers/markdown_renderer.rb', line 9

def compile(layout)
  Kramdown::Document.new(
    layout,
    syntax_highlighter: 'rouge',
    parse_block_html: true,
    fenced_code_blocks: true,
    input: 'GFM',
    with_toc_data: true,
    smartypants: true,
    hard_wrap: false
  )
end

#render_content(compiled, _content, _scope, _data) ⇒ Object



22
23
24
# File 'lib/frontman/renderers/markdown_renderer.rb', line 22

def render_content(compiled, _content, _scope, _data)
  compiled.to_html
end