We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2e335db commit e98fcd8Copy full SHA for e98fcd8
1 file changed
lib/impress_renderer.rb
@@ -31,7 +31,16 @@ def hrule
31
end
32
33
def block_code code, lang
34
- "<pre><code class='prettyprint #{lang}'>#{code}</code></pre>"
+ if lang == 'dot'
35
+ file = Tempfile.new(['mdpress','.dot'])
36
+ file << code
37
+ file.close
38
+ svg_file = file.path.gsub(%r{.*/},'')+'.svg'
39
+ puts `dot #{file.path} -Tsvg > ./presentation/#{svg_file}`
40
+ "<img src='#{svg_file}' />"
41
+ else
42
+ "<pre><code class='prettyprint #{lang}'>#{code}</code></pre>"
43
+ end
44
45
46
def codespan code
@@ -92,4 +101,3 @@ def doc_footer
92
101
}
93
102
94
103
95
-
0 commit comments