lib/review/ewbbuilder.rb in review-1.0.0 vs lib/review/ewbbuilder.rb in review-1.1.0
- old
+ new
@@ -27,20 +27,21 @@
puts unless level == 1
puts "//#{'i' * level} #{caption}"
puts
end
- Compiler.defsyntax(:emlist, :block, 0..1) {|args|
- if args[0] and not args[0] == 'noescape'
- raise SyntaxError, "unknown //emlist option: #{args[0]}"
- end
- }
+# Compiler.defsyntax(:emlist, :block, 0..1) {|args|
+# if args[0] and not args[0] == 'noescape'
+# raise SyntaxError, "unknown //emlist option: #{args[0]}"
+# end
+# }
- def emlist(lines, noescape = false)
+ def emlist(lines, caption = nil)
firstline = f.lineno
puts
- puts '//lst1{'
+ puts caption
+ puts "//lst1"
lines.each do |line|
if noescape
puts detab(line)
else
puts escape(detab(line))
@@ -48,19 +49,20 @@
end
puts '//}'
puts
end
- Compiler.defsyntax(:cmd, :block, 0..1) {|args|
- if args[0] and not args[0] == 'noescape'
- raise SyntaxError, "unknown //cmd option: #{args[0]}"
- end
- }
+# Compiler.defsyntax(:cmd, :block, 0..1) {|args|
+# if args[0] and not args[0] == 'noescape'
+# raise SyntaxError, "unknown //cmd option: #{args[0]}"
+# end
+# }
- def cmd(lines, noescape = false)
+ def cmd(lines, caption = nil)
puts
- puts '//sc1{'
+ puts caption
+ puts "//sc1{"
lines.each do |line|
if noescape
puts detab(line)
elsif /\AC:.*?>(.+)/ =~ line # DOS prompt hack
prompt, cmd = *line.split('>', 2)
@@ -71,18 +73,18 @@
end
puts '//}'
puts
end
- Compiler.defsyntax(:list, :block, 0..1) {|args|
- if args[0] and not args[0] == 'noescape'
- raise SyntaxError, "unknown //list option: #{args[0]}"
- end
- }
+# Compiler.defsyntax(:list, :block, 0..1) {|args|
+# if args[0] and not args[0] == 'noescape'
+# raise SyntaxError, "unknown //list option: #{args[0]}"
+# end
+# }
- def list(lines, noescape = false)
+ def list(lines, id, caption)
puts
- puts "//l#{list_number(ident)} " + caption
+ puts "//l#{list_number(id)} " + caption
puts '//lst2{'
lines.each do |line|
puts escape(detab(line))
end
puts '//}'