Class: Kramdown::Parser::Marsdawn
- Inherits:
-
Kramdown
- Object
- Kramdown
- Kramdown::Parser::Marsdawn
- Defined in:
- lib/marsdawn/source/kramdown/parser.rb
Class Method Summary collapse
Instance Method Summary collapse
- #handle_extension(name, opts, body, type) ⇒ Object
- #parse ⇒ Object
- #parse_atx_header ⇒ Object
- #parse_setext_header ⇒ Object
Class Method Details
.front_matter ⇒ Object
5 6 7 |
# File 'lib/marsdawn/source/kramdown/parser.rb', line 5 def self.front_matter @@front_matter end |
Instance Method Details
#handle_extension(name, opts, body, type) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/marsdawn/source/kramdown/parser.rb', line 26 def handle_extension(name, opts, body, type) case name when 'front_matter' opts.each do |key, val| @@front_matter[key.to_sym] = val @@front_matter[:link_key] = val if key == 'title' end true else super name, opts, body, type end end |
#parse ⇒ Object
9 10 11 12 |
# File 'lib/marsdawn/source/kramdown/parser.rb', line 9 def parse @@front_matter = {} super end |
#parse_atx_header ⇒ Object
20 21 22 23 24 |
# File 'lib/marsdawn/source/kramdown/parser.rb', line 20 def parse_atx_header ret = super handle_header @src[2].to_s.strip, @src[1].length ret end |
#parse_setext_header ⇒ Object
14 15 16 17 18 |
# File 'lib/marsdawn/source/kramdown/parser.rb', line 14 def parse_setext_header ret = super handle_header @src[1], @src[3].to_i ret end |