Module: CommonMarker::Rouge
- Defined in:
- lib/common_marker/rouge.rb
Overview
rouge
Class Method Summary collapse
- .render_doc(text, cmark_options = :DEFAULT, extensions = [], **cmr_options) ⇒ Object
- .render_html(text, cmark_options = :DEFAULT, render_options = :UNSAFE, extensions = [], **cmr_options) ⇒ Object
Class Method Details
.render_doc(text, cmark_options = :DEFAULT, extensions = [], **cmr_options) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/common_marker/rouge.rb', line 9 def render_doc(text, = :DEFAULT, extensions = [], **) cmark = [:cmark_class] || ::CommonMarker ast = cmark.render_doc(text, , extensions) process_ast(ast, ) ast end |
.render_html(text, cmark_options = :DEFAULT, render_options = :UNSAFE, extensions = [], **cmr_options) ⇒ Object
17 18 19 20 21 |
# File 'lib/common_marker/rouge.rb', line 17 def render_html(text, = :DEFAULT, = :UNSAFE, extensions = [], **) doc = render_doc(text, , extensions, **) CommonMarker::CustomHtmlRenderer.new(options: , extensions: extensions).render(doc) # doc.to_html(render_options) end |