better graph handling

This commit is contained in:
Yann Esposito 2012-10-11 16:52:20 +02:00
parent 6ea6ba256d
commit 0d66fc712f

View file

@ -55,8 +55,13 @@ class Graph < Nanoc3::Filter
FileUtils.mkdir_p('output'+@item.path+'graph')
webpath=@item.path + 'graph/' + filename + '.png'
path='output'+webpath
# puts "dot -Tpng -o #{path} /tmp/graphtemp.dot"
system("dot -Tpng -o #{path} /tmp/graphtemp.dot")
if str.match(/pos=/)
prog="neato"
else
prog="dot"
end
# puts "#{prog} -Tpng -o #{path} /tmp/graphtemp.dot"
system("#{prog} -Tpng -o #{path} /tmp/graphtemp.dot")
# puts %{<img alt="#{title}" src="#{webpath}"/>}
%{<figure><img alt="#{title}" src="#{webpath}"/><figcaption>#{title}</figcaption></figure>}
end