class Kramdown::Parser::Slider

ToDo: clean up!

Public Class Methods

new(source, options) click to toggle source
Calls superclass method
# File lib/slideshift/tool/render/markdown.rb, line 9
def initialize(source, options)
  super
  @block_parsers.unshift(:syntax_tag)
  @block_parsers.unshift(:slide_tag)
end

Public Instance Methods

parse_slide_tag() click to toggle source
# File lib/slideshift/tool/render/markdown.rb, line 24
def parse_slide_tag
  @src.pos += @src.matched_size
  @tree.children << Element.new(:raw, '</section><section class="slide">')
end
parse_syntax_tag() click to toggle source
# File lib/slideshift/tool/render/markdown.rb, line 15
def parse_syntax_tag
  match = /^```(\w+)\n(.*)\n```$/m.match(@src.matched)
  @src.pos += @src.matched_size
  code = Pygments.highlight(match[2], :lexer => match[1], :options => {
      :encoding => 'utf-8'
  })
  @tree.children << Element.new(:raw, code)
end