Class: ActiveCopy::Markdown
- Inherits:
-
Object
- Object
- ActiveCopy::Markdown
- Defined in:
- lib/active_copy/markdown.rb
Instance Method Summary collapse
-
#initialize ⇒ Markdown
constructor
Create a new session with the compiler.
-
#render(markdown_source) ⇒ Object
Return an HTML String containing the rendered output of the Markdown source.
Constructor Details
#initialize ⇒ Markdown
Create a new session with the compiler.
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/active_copy/markdown.rb', line 11 def initialize @renderer = ActiveCopy::Renderer.new @options = { autolink: true, no_intra_emphasis: true, fenced_code_blocks: true, lax_html_blocks: true, strikethrough: true, superscript: true } end |
Instance Method Details
#render(markdown_source) ⇒ Object
Return an HTML String containing the rendered output of the Markdown source.
25 26 27 |
# File 'lib/active_copy/markdown.rb', line 25 def render markdown_source markdown.render "#{markdown_source}" end |