Use the new pandoc syntax.

This commit is contained in:
Niels G. W. Serup 2018-08-21 19:16:55 +02:00
parent f1bfdc5477
commit 1c82949a0e
1 changed files with 4 additions and 4 deletions

View File

@ -35,13 +35,13 @@ site_dir = os.path.join(base_dir, 'site')
def pandoc(filename): def pandoc(filename):
proc = subprocess.run(['pandoc', '--smart', filename], proc = subprocess.run(['pandoc', '-f', 'markdown+smart', filename],
stdout=subprocess.PIPE) stdout=subprocess.PIPE)
return proc.stdout.decode('utf-8').strip() return proc.stdout.decode('utf-8').strip()
def pandoc_stdin(text, from_type): def pandoc_stdin(text):
out = subprocess.Popen( out = subprocess.Popen(
['pandoc', '--smart', '-f', from_type], ['pandoc', '-f', 'markdown+smart'],
stdin=subprocess.PIPE, stdout=subprocess.PIPE).communicate(text.encode('utf-8'))[0] stdin=subprocess.PIPE, stdout=subprocess.PIPE).communicate(text.encode('utf-8'))[0]
return out.decode('utf-8').strip() return out.decode('utf-8').strip()
@ -115,7 +115,7 @@ def markdown_to_html(input_file, output_dir):
md += '[{}]({})\n ~ {}\n\n'.format(ptitle, url, pabstract) md += '[{}]({})\n ~ {}\n\n'.format(ptitle, url, pabstract)
bottom = md bottom = md
content = pandoc_stdin(top + '\n' + bottom, 'markdown') content = pandoc_stdin(top + '\n' + bottom)
else: else:
content = pandoc(input_file) content = pandoc(input_file)