Class: Kramdown::Parser::KramdownPages

Inherits:
Kramdown
  • Object
show all
Defined in:
lib/kramdown-pages/parser/kramdown.rb

Instance Method Summary collapse

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, options)
  super
  @span_parsers.unshift(:page)
end

Instance Method Details

#parse_pageObject



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