diff options
-rw-r--r-- | data/style.css | 16 | ||||
-rw-r--r-- | trivium.rb | 5 |
2 files changed, 21 insertions, 0 deletions
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? %{<div class="math"><img alt="#{CGI.escapeHTML body}" src="#{ MATH_TEX}#{CGI.escape(body).gsub('+', '%20')}"></div>} + when "thumb" + '<div class="thumbs">' + body.split(/\n{2,}/).map { |para| + alt, thumb, img = para.strip.split("\n", 3) + %{<a class="thumb" href="#{img}"><img src="#{thumb}" alt="#{alt}"></a>} + }.join("\n") + '</div>' else %{<div class="#{name}">#{ BlueCloth.new(Dots.new(body).to_html).to_html}</div>} |