Class: Zlide::Redcarpet::Renderers::HTML

Inherits:
Redcarpet::Render::HTML
  • Object
show all
Defined in:
lib/zlide/redcarpet/renderers/html.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ HTML

Returns a new instance of HTML.



7
8
9
10
# File 'lib/zlide/redcarpet/renderers/html.rb', line 7

def initialize(options = {})
  @slide_open = false
  super(options)
end

Instance Method Details



24
25
26
27
28
29
# File 'lib/zlide/redcarpet/renderers/html.rb', line 24

def doc_footer
  if @slide_open
    @slide_open = false
    "</section>"
  end
end

#paragraph(text) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/zlide/redcarpet/renderers/html.rb', line 12

def paragraph(text)
  result = ""
  if text =~ /^!SLIDE/
    result += "</section>\n" if @slide_open
    result += "<section class=\"slide\">\n"
    @slide_open = true
  else
    result += "<p>#{text}</p>\n"
  end
  result
end