diff options
author | iximeow <me@iximeow.net> | 2018-01-01 18:34:24 -0800 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2018-01-01 18:34:24 -0800 |
commit | 19d0ceb8e6f73ff98757772ad6eaefaaece3b56f (patch) | |
tree | 8690416c80e405819319ce21a7c9424d412cdafc | |
parent | d06eb38d9cf6f04a16e56a5977a2db2f05a23854 (diff) |
use pandoc tempalte instead of headers file
fix quirk in #eval inclusion that messed up spacing on the first line
-rw-r--r-- | generator/generate.py | 4 |
1 files 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 + '<pre>' + evald_text + '</pre>\n' + result = result + '<pre>\n' + evald_text + '</pre>\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): |