File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -54,12 +54,13 @@ def hrule
5454 end
5555
5656 def block_code code , lang
57- if lang == 'dot'
57+ if lang =~ /^dot/
58+ _ , size = lang . split ( '-' )
5859 file = Tempfile . new ( [ 'mdpress' , '.dot' ] )
5960 file << code
6061 file . close
6162 "<div class='dot-wrap'>" +
62- ( Nokogiri ( `dot #{ file . path } -Tsvg` ) /'svg' ) . first . tap { |svg | svg . search ( 'polygon' ) . first . remove ; svg [ 'width' ] = '600px ' ; svg . attributes [ 'height' ] . remove } . to_html +
63+ ( Nokogiri ( `dot #{ file . path } -Tsvg` ) /'svg' ) . first . tap { |svg | svg . search ( 'polygon' ) . first . remove ; svg [ 'width' ] = ( size || '600' ) + 'px ' ; svg . attributes [ 'height' ] . remove } . to_html +
6364 "</div>"
6465 elsif lang == 'notes'
6566 "<div class='notes' style='display:none;'>#{ code } </div>"
@@ -111,6 +112,17 @@ def doc_header
111112<link href="css/highlight.css" type="text/css" rel="stylesheet" />
112113<script type="text/javascript" src="js/highlight.pack.js"></script>
113114<script>hljs.initHighlightingOnLoad();</script>
115+ <script type="text/javascript">
116+ var _gaq = _gaq || [];
117+ _gaq.push(['_setAccount', 'UA-16178122-1']);
118+ _gaq.push(['_trackPageview']);
119+
120+ (function() {
121+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
122+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
123+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
124+ })();
125+ </script>
114126#{ mathjax }
115127 <link href="css/style.css" rel="stylesheet" />
116128#{ @head }
You can’t perform that action at this time.
0 commit comments