From b68840aa2396103e26e03c1046136a526399e824 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Sun, 21 Sep 2008 01:02:03 +0200 Subject: Reflow code --- trivium.rb | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/trivium.rb b/trivium.rb index 2680a6e..b8e3e37 100644 --- a/trivium.rb +++ b/trivium.rb @@ -41,7 +41,8 @@ end class InlineMath < String MATH_TEX = 'http://vuxu.org/~chris/mathtex/mathtex.cgi?' + - CGI.escape('\textstyle{}\usepackage{color}\color{white}\rule[-0.333em]{0.01pt}{1.2em}\color{black}') + CGI.escape('\textstyle{}\usepackage{color}' + + '\color{white}\rule[-0.333em]{0.01pt}{1.2em}\color{black}') def to_html gsub(/\$(.*?)\$/) { @@ -61,8 +62,8 @@ class Dots < String case name when "link" title, desc = body.split("|", 2) - # why does bluecloth need those div? - %{} + %{} when "quote" if args.strip.empty? src = "" @@ -74,9 +75,11 @@ class Dots < String %{
#{BlueCloth.new(text).to_html}
} when "math" body << "\\eqno{#{args.strip}}" unless args.strip.empty? - %{
#{CGI.escapeHTML body}
} + %{
#{CGI.escapeHTML body}
} else - %{
#{BlueCloth.new(Dots.new(body).to_html).to_html}
} + %{
#{ + BlueCloth.new(Dots.new(body).to_html).to_html}
} end } end @@ -139,14 +142,16 @@ chain(monthly, "month") monthly.each { |month, entries| entry = entries.first dep "html/#{month}.html", "template/monthly.ht", *deps(entry) do |dst| - File.write(dst, template("template/monthly.ht", :entries => entries, :month => month)) + File.write(dst, template("template/monthly.ht", + :entries => entries, :month => month)) end } front = ENTRIES.first(10) d = front.map { |e| e[:file] } dep "html/index.html", "template/front.ht", *d do |dst| - File.write(dst, template("template/front.ht", :entries => front, :next => monthly.last)) + File.write(dst, template("template/front.ht", + :entries => front, :next => monthly.last)) end feed = ENTRIES.first(20) -- cgit 1.4.1