Class: Marker::Document

Inherits:
ParseNode show all
Defined in:
lib/marker/markup.rb

Instance Method Summary collapse

Methods inherited from Treetop::Runtime::SyntaxNode

#present?

Instance Method Details

#make_options(user_options) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/marker/markup.rb', line 30

def make_options( user_options )
  o = Marker.render_options.dup
  o.merge!( :link_base => Marker.link_base )
  o.merge!( :footnotes => Footnotes.new ) unless user_options[:nofootnotes]
  o.merge!( user_options )
  o
end

#markupObject

– defaults ++



39
40
41
# File 'lib/marker/markup.rb', line 39

def markup
  nil
end

#to_html(options = {}) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/marker/markup.rb', line 11

def to_html( options = {} )
  options = make_options( options )

  markup ? (
    markup.to_html( options ) + "\n" +
    options[:footnotes].to_html( options )
  ) : ""
end

#to_s(options = {}) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/marker/markup.rb', line 20

def to_s( options = {} )
  options = make_options( options )


  markup ? (
    markup.to_s( options ) + "\n\n" +
    options[:footnotes].to_s( options )
  ) : ""
end