attempt to enable bibligraphy but founder in relative file paths
This commit is contained in:
parent
2fdb5b20b2
commit
6fe6277a25
@ -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,9 +88,10 @@ 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(
|
||||||
stdin=subprocess.PIPE,
|
pandoc_cmd,
|
||||||
stdout=subprocess.PIPE)
|
stdin=subprocess.PIPE,
|
||||||
|
stdout=subprocess.PIPE)
|
||||||
|
|
||||||
output = proc.communicate(content.encode('utf-8'))[0].decode('utf-8')
|
output = proc.communicate(content.encode('utf-8'))[0].decode('utf-8')
|
||||||
status = proc.wait()
|
status = proc.wait()
|
||||||
|
Loading…
Reference in New Issue
Block a user