Module: Slideshow::MarkdownEngines

Included in:
Gen
Defined in:
lib/slideshow/markdown.rb

Instance Method Summary collapse

Instance Method Details

#markdown_to_html(content) ⇒ Object

note: for now keep it simple use just kramdown



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/slideshow/markdown.rb', line 8

def markdown_to_html( content )    
  ## note: set to gfm (github-flavored markdown) by default

  ##   see http://kramdown.gettalong.org/parser/gfm.html

  kramdown_config = {
    'input'     => 'GFM',
    'hard_wrap' => false
  }

  puts "  Converting markdown-text (#{content.length} bytes) to HTML using kramdown library with #{kramdown_config.inspect}..."
  
  Kramdown::Document.new( content, kramdown_config ).to_html
end