From 787f63cd42025ca3143acaa9fdbd0cb3333e7c35 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Wed, 24 Sep 2008 18:16:41 +0200 Subject: Support for thumbnails --- data/style.css | 16 ++++++++++++++++ trivium.rb | 5 +++++ 2 files changed, 21 insertions(+) diff --git a/data/style.css b/data/style.css index e2cfc5e..476d69b 100644 --- a/data/style.css +++ b/data/style.css @@ -136,6 +136,22 @@ img.inline-math { } +.thumbs a { + background-color: #ffffff; + outline: none; +} + +.thumb img { + width: 220px; + margin: 8px 8px 0 0; +} + +.thumb img.full { + width: 454px; + margin: 8px 0 0 0; +} + + .nav { font-size: 12px; display: block; diff --git a/trivium.rb b/trivium.rb index 933f853..a73c553 100644 --- a/trivium.rb +++ b/trivium.rb @@ -77,6 +77,11 @@ class Dots < String body << "\\eqno{#{args.strip}}" unless args.strip.empty? %{
#{CGI.escapeHTML body}
} + when "thumb" + '
' + body.split(/\n{2,}/).map { |para| + alt, thumb, img = para.strip.split("\n", 3) + %{#{alt}} + }.join("\n") + '
' else %{
#{ BlueCloth.new(Dots.new(body).to_html).to_html}
} -- cgit 1.4.1