plugin/bookish.rb in livetext-0.9.02 vs plugin/bookish.rb in livetext-0.9.03

- old
+ new

@@ -86,11 +86,12 @@ # _errout("chapter") @chapter = @_args.first.to_i @sec = @sec2 = 0 title = @_data.split(" ",2)[1] @toc << "<br><b>#@chapter</b> #{title}<br>" - _next_output(_slug(title)) + @_data = _slug(title) + next_output _out "<title>#{@chapter}. #{title}</title>" _out <<-HTML <h2>Chapter #{@chapter}</h1> <h1>#{title}</h1> @@ -101,11 +102,12 @@ @chapter += 1 @sec = @sec2 = 0 title = @_data # .split(" ",2)[1] _errout("Chapter #@chapter: #{title}") @toc << "<br><b>#@chapter</b> #{title}<br>" - _next_output(_slug(title)) + @_data = _slug(title) + next_output _out "<title>#{@chapter}. #{title}</title>" _out <<-HTML <h2>Chapter #{@chapter}</h1> <h1>#{title}</h1> @@ -116,11 +118,12 @@ @sec += 1 @sec2 = 0 @section = "#@chapter.#@sec" # _errout("section #@section") @toc << "#{_nbsp(3)}<b>#@section</b> #@_data<br>" - _next_output(_slug(@_data)) + @_data = _slug(@_data) + next_output _out "<h3>#@section #{@_data}</h3>\n" rescue => err STDERR.puts "#{err}\n#{err.backtrace}" exit end @@ -128,11 +131,12 @@ def subsec @sec2 += 1 @subsec = "#@chapter.#@sec.#@sec2" @toc << "#{_nbsp(6)}<b>#@subsec</b> #@_data<br>" # _errout("section #@subsec") - _next_output(_slug(@_data)) + @_data = _slug(@_data) + next_output _out "<h3>#@subsec #{@_data}</h3>\n" end def table2 title = @_data @@ -244,15 +248,15 @@ end def missing @toc << "#{_nbsp(8)}<font color=red>TBD: #@_data</font><br>" stuff = @_data.empty? ? "" : ": #@_data" - _print "<br><font color=red><i>[Material missing#{stuff}]</i></font><br>\n " + _out "<br><font color=red><i>[Material missing#{stuff}]</i></font><br>\n " end def TBC @toc << "#{_nbsp(8)}<font color=red>To be continued...</font><br>" - _print "<br><font color=red><i>To be continued...</i></font><br>" + _out "<br><font color=red><i>To be continued...</i></font><br>" end def note _out "<br><font color=red><i>Note: " _out @_data