Class: Malt::Format::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(*data, &context) ⇒ Object
- #latex(*data, &content) ⇒ 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, file_extension, #file_read, #file_type, #parse_type_from_data, #refile, register, #render, #render_into, #rendering_parameters, #scope_vs_data, #subtype, #text, #to, #to_default, #to_s, #type, #with, #with!
Instance Method Details
#html(*data, &context) ⇒ Object
32 33 34 35 |
# File 'lib/malt/formats/markdown.rb', line 32 def html(*data, &context) #engine.render(:text=>text, :file=>file, :format=>:html) render_into(:html, *data, &context) end |
#latex(*data, &content) ⇒ Object
44 45 46 47 |
# File 'lib/malt/formats/markdown.rb', line 44 def latex(*data, &content) render_into(:latex, *data, &content) #render_engine.render(:text=>text, :file=>file, :format=>:latex) end |
#markdown ⇒ Object Also known as: md
18 19 20 |
# File 'lib/malt/formats/markdown.rb', line 18 def markdown(*) text end |
#to_html ⇒ Object
Convert to HTML.
38 39 40 41 |
# File 'lib/malt/formats/markdown.rb', line 38 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.
50 51 52 53 |
# File 'lib/malt/formats/markdown.rb', line 50 def to_latex(*) opts = .merge(:text=>html, :file=>refile(:latex), :type=>:latex) Latex.new(opts) end |
#to_markdown ⇒ Object Also known as: to_md
25 26 27 |
# File 'lib/malt/formats/markdown.rb', line 25 def to_markdown(*) self end |