Module: Prawndown::Interface
- Defined in:
- lib/prawndown.rb
Instance Method Summary collapse
-
#markdown(string, options = {}) ⇒ Object
Renders Markdown in the current document.
Instance Method Details
#markdown(string, options = {}) ⇒ Object
Renders Markdown in the current document
It supports header 1-6, bold text, italic text, strikethrough and links It supports the same options as Prawn::Document#text
Prawn::Document.generate('markdown.pdf') do
markdown '# Welcome to Prawndown!'
markdown '**Important:** We _hope_ you enjoy your stay!'
end
16 17 18 |
# File 'lib/prawndown.rb', line 16 def markdown(string, = {}) text Prawndown::Parser.new(string).to_prawn, .merge(inline_format: true) end |