2
require 'rd/labeled-element'
5
# Block-level Element of document tree. abstruct class.
6
class BlockElement < Element
9
class Headline < BlockElement
10
include NonterminalElement
11
include LabeledElement
25
def initialize(level_num)
32
visitor.visit_Headline(self)
42
private :calculate_label
44
def Headline.mark_to_level(mark_str)
45
MARK2LEVEL[mark_str] or
46
raise ArgumentError, "#{mark_str} is irregular for Headline mark."
54
class Include < BlockElement
55
include TerminalElement
57
attr_accessor :filename
59
def initialize(filename)
65
visitor.visit_Include(self)
69
class TextBlock < BlockElement
70
include NonterminalElement
72
attr_accessor :content
80
visitor.visit_TextBlock(self)
88
class Verbatim < BlockElement
89
include TerminalElement
93
def initialize(content_strings = [])
95
@content = content_strings # Array of String
99
visitor.visit_Verbatim(self)
103
if @content.respond_to?(:each_line)
104
@content.each_line {|i|