Class: Yarrow::Format::Markdown
- Inherits:
-
Object
- Object
- Yarrow::Format::Markdown
- Includes:
- Yarrow::Format::Methods::FrontMatter
- Defined in:
- lib/yarrow/format/markdown.rb
Instance Method Summary collapse
-
#initialize(source) ⇒ Markdown
constructor
A new instance of Markdown.
- #links ⇒ Object
- #title ⇒ Object
- #to_dom ⇒ Object
- #to_html ⇒ Object
- #to_s ⇒ Object
Methods included from Yarrow::Format::Methods::FrontMatter
Constructor Details
#initialize(source) ⇒ Markdown
Returns a new instance of Markdown.
6 7 8 9 |
# File 'lib/yarrow/format/markdown.rb', line 6 def initialize(source) @source = source.to_s @document = Kramdown::Document.new(@source) end |
Instance Method Details
#links ⇒ Object
23 24 25 |
# File 'lib/yarrow/format/markdown.rb', line 23 def links @links ||= select_links end |
#title ⇒ Object
27 28 29 |
# File 'lib/yarrow/format/markdown.rb', line 27 def title @title ||= select_title end |
#to_dom ⇒ Object
15 16 17 |
# File 'lib/yarrow/format/markdown.rb', line 15 def to_dom @document.root end |
#to_html ⇒ Object
19 20 21 |
# File 'lib/yarrow/format/markdown.rb', line 19 def to_html @document.to_html end |
#to_s ⇒ Object
11 12 13 |
# File 'lib/yarrow/format/markdown.rb', line 11 def to_s @source end |