Skip to content

Commit

Permalink
Wrap the dot output in a div for styling, and only remove the first p…
Browse files Browse the repository at this point in the history
…olygon (the background) but not the rest.
  • Loading branch information
plexus committed Jun 7, 2013
1 parent a237234 commit 44d48f6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/impress_renderer.rb
Expand Up @@ -55,7 +55,9 @@ def block_code code, lang
file = Tempfile.new(['mdpress','.dot']) file = Tempfile.new(['mdpress','.dot'])
file << code file << code
file.close file.close
(Nokogiri(`dot #{file.path} -Tsvg`)/'svg').tap{|svg| svg.search('polygon').remove}.to_html "<div class='dot-wrap'>" +
(Nokogiri(`dot #{file.path} -Tsvg`)/'svg').tap{|svg| svg.search('polygon').first.remove}.to_html +
"</div>"
elsif lang == 'notes' elsif lang == 'notes'
"<div class='notes' style='display:none;'>#{code}</div>" "<div class='notes' style='display:none;'>#{code}</div>"
else else
Expand Down

0 comments on commit 44d48f6

Please sign in to comment.