Class: Kramdown::Parser::KramdownPages
- Inherits:
-
Kramdown
- Object
- Kramdown
- Kramdown::Parser::KramdownPages
- Defined in:
- lib/kramdown-pages/parser/kramdown.rb
Instance Method Summary collapse
-
#initialize(source, options) ⇒ KramdownPages
constructor
A new instance of KramdownPages.
- #parse_page ⇒ Object
Constructor Details
#initialize(source, options) ⇒ KramdownPages
Returns a new instance of KramdownPages.
8 9 10 11 |
# File 'lib/kramdown-pages/parser/kramdown.rb', line 8 def initialize(source, ) super @span_parsers.unshift(:page) end |
Instance Method Details
#parse_page ⇒ Object
13 14 15 16 17 |
# File 'lib/kramdown-pages/parser/kramdown.rb', line 13 def parse_page @src.pos += @src.matched_size permalink = @src[1] @tree.children << Element.new(:page, permalink) end |