Class: MdReader::Converter
- Inherits:
-
Object
- Object
- MdReader::Converter
- Defined in:
- lib/md_reader.rb
Constant Summary collapse
- MARKDOWN_EXTENSIONS =
{ fenced_code_blocks: true, tables: true, autolink: true, strikethrough: true, superscript: true, highlight: true, footnotes: true, no_intra_emphasis: true }.freeze
Instance Method Summary collapse
Instance Method Details
#call(content, title = "Document") ⇒ Object
25 26 27 28 29 30 |
# File 'lib/md_reader.rb', line 25 def call(content, title = "Document") renderer = HTMLWithHighlight.new(hard_wrap: true, with_toc_data: true) markdown = Redcarpet::Markdown.new(renderer, MARKDOWN_EXTENSIONS) body = markdown.render(content) html_template(body, title) end |