attempt to enable bibligraphy but founder in relative file paths

This commit is contained in:
Dan MacKinlay 2019-02-23 16:14:24 +11:00
parent 2fdb5b20b2
commit 6fe6277a25

View File

@ -64,18 +64,19 @@ class PandocReader(BaseReader):
bib_header = self.settings.get('PANDOC_BIBHEADER', None) 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', '') extensions = self.settings.get('PANDOC_EXTENSIONS', '')
if isinstance(extensions, list): if isinstance(extensions, list):
extensions = ''.join(extensions) extensions = ''.join(extensions)
extra_args = self.settings.get('PANDOC_ARGS', []) extra_args = self.settings.get('PANDOC_ARGS', [])
extensions = self.settings.get('PANDOC_EXTENSIONS', '') extensions = self.settings.get('PANDOC_EXTENSIONS', '')
if isinstance(extensions, list): if isinstance(extensions, list):
extensions = ''.join(extensions) extensions = ''.join(extensions)
pandoc_cmd = ["pandoc", "--from=markdown" + extensions, "--to=html5"] pandoc_cmd = ["pandoc", "--from=markdown" + extensions, "--to=html5"]
for filt in filters:
pandoc_cmd.extend(["--filter", filt])
pandoc_cmd.extend(extra_args) pandoc_cmd.extend(extra_args)
if "bibliography" in metadata.keys(): if "bibliography" in metadata.keys():
@ -87,7 +88,8 @@ class PandocReader(BaseReader):
'--metadata=reference-section-title="{}"'.format( '--metadata=reference-section-title="{}"'.format(
bib_header)] bib_header)]
proc = subprocess.Popen(pandoc_cmd, proc = subprocess.Popen(
pandoc_cmd,
stdin=subprocess.PIPE, stdin=subprocess.PIPE,
stdout=subprocess.PIPE) stdout=subprocess.PIPE)