Class: Malt::Formats::Markdown
- Defined in:
- lib/malt/formats/markdown.rb
Overview
If using the Kramdown engine, then Latex is also a supported output format.
Instance Attribute Summary
Attributes inherited from Abstract
Instance Method Summary collapse
- #html ⇒ Object
- #latex ⇒ Object
- #markdown ⇒ Object (also: #md)
-
#to_html ⇒ Object
Convert to HTML.
-
#to_latex ⇒ Object
Latex is only supported by the Kramdown engine.
- #to_markdown ⇒ Object (also: #to_md)
Methods inherited from Abstract
#default, engine, #engine, #extensions, extensions, #file, #parse_type_and_data, #refile, register, #render, #subtype, #text, #to, #to_s, #type
Instance Method Details
#html ⇒ Object
15 16 17 |
# File 'lib/malt/formats/markdown.rb', line 15 def html render_engine.render(:text=>text, :file=>file, :format=>:html) end |
#latex ⇒ Object
20 21 22 |
# File 'lib/malt/formats/markdown.rb', line 20 def latex render_engine.render(:text=>text, :file=>file, :format=>:latex) end |
#markdown ⇒ Object Also known as: md
25 26 27 |
# File 'lib/malt/formats/markdown.rb', line 25 def markdown text end |
#to_html ⇒ Object
Convert to HTML.
33 34 35 36 |
# File 'lib/malt/formats/markdown.rb', line 33 def to_html opts = .merge(:text=>html, :file=>refile(:html), :type=>:html) HTML.new(opts) end |
#to_latex ⇒ Object
Latex is only supported by the Kramdown engine.
39 40 41 42 |
# File 'lib/malt/formats/markdown.rb', line 39 def to_latex opts = .merge(:text=>html, :file=>refile(:latex), :type=>:latex) Latex.new(opts) end |
#to_markdown ⇒ Object Also known as: to_md
45 46 47 |
# File 'lib/malt/formats/markdown.rb', line 45 def to_markdown self end |