plugin/bookish.rb in livetext-0.9.21 vs plugin/bookish.rb in livetext-0.9.22
- old
+ new
@@ -16,11 +16,11 @@
def h1; _out "<h1>#{@_data}</h1>"; end
def h2; _out "<h2>#{@_data}</h2>"; end
def h3; _out "<h3>#{@_data}</h3>"; end
def alpha_columns(args = nil, body = nil)
- n = @_args.first.to_i # FIXME: what if missing?
+ n = @_args.first.to_i # FIXME: what if it's missing?
words = []
_body do |line|
words << line.chomp
end
words.sort!
@@ -48,12 +48,12 @@
s2 = str.chomp.strip.gsub(/[?:,()'"\/]/,"").gsub(/ /, "-").downcase
# _errout "SLUG: #{str} => #{s2}"
s2
end
-
# FIXME duplicated?
+
def image(args = nil, body = nil)
name = @_args[0]
_out "<img src='#{name}'></img>"
end
@@ -65,11 +65,10 @@
_out "<img src='#{name}'></img>"
_out "<center><b>Figure #{num}</b> #{title}</center>"
end
def chapter(args = nil, body = nil)
-# _errout("chapter")
@chapter = @_args.first.to_i
@sec = @sec2 = 0
title = @_data.split(" ",2)[1]
@toc << "<br><b>#@chapter</b> #{title}<br>"
@_data = _slug(title)
@@ -106,11 +105,11 @@
@toc << "#{_nbsp(3)}<b>#@section</b> #{title}<br>"
@_data = _slug(@_data)
next_output
_out "<h3>#@section #{title}</h3>\n"
rescue => err
- STDERR.puts "#{err}\n#{err.backtrace}"
+ ::STDERR.puts "#{err}\n#{err.backtrace}"
exit
end
def subsec(args = nil, body = nil)
@sec2 += 1
@@ -273,10 +272,10 @@
def quote(args = nil, body = nil)
_out "<blockquote>"
_body {|line| _out line }
_out "</blockquote>"
rescue => err
- STDERR.puts "#{err}\n#{err.backtrace}"
+ ::STDERR.puts "#{err}\n#{err.backtrace}"
exit
end
def init_bookish
@toc_file = "toc.tmp"