##// END OF EJS Templates
use markdown package instead instead of subprocess
Matthias BUSSONNIER -
Show More
@@ -24,6 +24,7 b' import sys'
24 24 import json
25 25 import copy
26 26 from shutil import rmtree
27 from markdown import markdown
27 28
28 29 inkscape = 'inkscape'
29 30 if sys.platform == 'darwin':
@@ -841,9 +842,7 b' class ConverterHTML(Converter):'
841 842 @DocInherit
842 843 @text_cell
843 844 def render_markdown(self, cell):
844 p = subprocess.Popen(['markdown'], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
845 out, _ = p.communicate(cell.source.encode('utf-8'))
846 return [out.decode('utf-8')]
845 return [markdown(cell.source)]
847 846
848 847 @DocInherit
849 848 def render_raw(self, cell):
@@ -1310,13 +1309,7 b' def md2html(infile):'
1310 1309 """Convert a markdown file to simplified html suitable for blogger.
1311 1310
1312 1311 """
1313
1314 proc = subprocess.Popen(['markdown', infile],
1315 stdout=subprocess.PIPE,
1316 stderr=subprocess.PIPE)
1317 html, stderr = proc.communicate()
1318 if stderr:
1319 raise IOError(stderr)
1312 html = markdown(open(infile).read())
1320 1313
1321 1314 from pygments.formatters import HtmlFormatter
1322 1315 css = HtmlFormatter().get_style_defs('.highlight')
General Comments 0
You need to be logged in to leave comments. Login now