class PseudoHiki::PageComposer::BaseComposer

Public Class Methods

new(options) click to toggle source
# File lib/pseudohiki/converter.rb, line 24
def initialize(options)
  @options = options
end

Public Instance Methods

compose_body(tree) click to toggle source
# File lib/pseudohiki/converter.rb, line 28
def compose_body(tree)
  @options.formatter.format(tree)
end

Private Instance Methods

collect_nodes_for_table_of_contents(tree) click to toggle source
# File lib/pseudohiki/converter.rb, line 40
def collect_nodes_for_table_of_contents(tree)
  Utils::NodeCollector.select(tree) {|node| toc_item_pat?(node) }
end
to_plain(line) click to toggle source
# File lib/pseudohiki/converter.rb, line 44
def to_plain(line)
  PlainFormat.format(line).to_s
end
toc_item_pat?(node) click to toggle source
# File lib/pseudohiki/converter.rb, line 34
def toc_item_pat?(node)
  node.kind_of?(PseudoHiki::BlockParser::HeadingLeaf) and
    (2..3).include? node.level and
    node.node_id
end