118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
|
# File 'lib/asciibuild/extensions.rb', line 118
def process parent, reader, attrs
doctitle = parent.document.attributes["doctitle"]
body = reader.read
puts ""
puts "#{doctitle} > #{parent.title} > #{attrs['title']}"
puts (">" * 80)
fname = if not include_section?(parent, attrs)
if parent.document.attributes["error"]
puts "Section \"#{parent.title}\" skipped due to previous error."
attrs['title'] = 'icon:pause-circle[role=red] ' + attrs['title'] + " (previous error)"
else
sections = parent.document.attributes["sections"].split(/,[ ]*/)
puts "Section \"#{parent.title}\" skipped. Does not match #{sections}."
attrs['title'] = 'icon:pause-circle[role=yellow] ' + attrs['title']
end
false
else
attrs["file"]
end
if fname
if not parent.document.attributes["#{parent.title} #{fname}"]
open(fname, 'w') do |f|
f.write("")
end
parent.document.attributes["#{parent.title} #{fname}"] = true
end
open(fname, 'a') do |f|
f.write(body + "\n")
end
puts body
end
puts ("<" * 80)
create_open_block parent, ["----", body, "----"], attrs
end
|