From 6fe6277a252676826076c67dfe4930e271a3333e Mon Sep 17 00:00:00 2001 From: Dan MacKinlay Date: Sat, 23 Feb 2019 16:14:24 +1100 Subject: [PATCH] attempt to enable bibligraphy but founder in relative file paths --- pandoc_reader.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pandoc_reader.py b/pandoc_reader.py index fd66158..985b00d 100644 --- a/pandoc_reader.py +++ b/pandoc_reader.py @@ -64,18 +64,19 @@ class PandocReader(BaseReader): bib_header = self.settings.get('PANDOC_BIBHEADER', None) - # filters = self.settings.get('PANDOC_FILTERS', []) + filters = self.settings.get('PANDOC_FILTERS', []) extensions = self.settings.get('PANDOC_EXTENSIONS', '') if isinstance(extensions, list): extensions = ''.join(extensions) - extra_args = self.settings.get('PANDOC_ARGS', []) extensions = self.settings.get('PANDOC_EXTENSIONS', '') if isinstance(extensions, list): extensions = ''.join(extensions) pandoc_cmd = ["pandoc", "--from=markdown" + extensions, "--to=html5"] + for filt in filters: + pandoc_cmd.extend(["--filter", filt]) pandoc_cmd.extend(extra_args) if "bibliography" in metadata.keys(): @@ -87,9 +88,10 @@ class PandocReader(BaseReader): '--metadata=reference-section-title="{}"'.format( bib_header)] - proc = subprocess.Popen(pandoc_cmd, - stdin=subprocess.PIPE, - stdout=subprocess.PIPE) + proc = subprocess.Popen( + pandoc_cmd, + stdin=subprocess.PIPE, + stdout=subprocess.PIPE) output = proc.communicate(content.encode('utf-8'))[0].decode('utf-8') status = proc.wait()