From 19d0ceb8e6f73ff98757772ad6eaefaaece3b56f Mon Sep 17 00:00:00 2001 From: iximeow Date: Mon, 1 Jan 2018 18:34:24 -0800 Subject: use pandoc tempalte instead of headers file fix quirk in #eval inclusion that messed up spacing on the first line --- generator/generate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generator/generate.py b/generator/generate.py index 60ac8f6..3c23b40 100644 --- a/generator/generate.py +++ b/generator/generate.py @@ -26,7 +26,7 @@ def replace_references(lines, file_dir): evald_text = eval_p.communicate()[0].decode('utf-8') if evald_text is None or len(evald_text.strip()) == 0: raise Exception("Evaluating `{}` produced no output".format(command)) - result = result + '
' + evald_text + '
\n' + result = result + '
\n' + evald_text + '
\n' except Exception as e: print("Error processing line {}:\n {}\nError: {}".format(i, line, e)) return None @@ -66,7 +66,7 @@ if __name__ == "__main__": print("Error compiling {}".format(md_source)) sys.exit(3) # now shove it all through pandoc - pandoc_proc = subprocess.Popen(['pandoc', '-H', headers_file], stdout=subprocess.PIPE, stdin=subprocess.PIPE) + pandoc_proc = subprocess.Popen(['pandoc', '--template=content_template.pandoc'], stdout=subprocess.PIPE, stdin=subprocess.PIPE) html = pandoc_proc.communicate(markdown_blob.encode('utf-8'))[0] try: if not os.path.isdir('./generated/' + page_cwd): -- cgit v1.1