summaryrefslogtreecommitdiffstats
path: root/nikola/plugins/compile/pandoc.py
diff options
context:
space:
mode:
authorLibravatarAgustin Henze <tin@sluc.org.ar>2015-07-08 07:35:02 -0300
committerLibravatarAgustin Henze <tin@sluc.org.ar>2015-07-08 07:35:02 -0300
commitb0b24795b24ee6809397fbbadf42f31f310a219f (patch)
tree46d05bb47460b4ec679211717c4ab07414b80d9c /nikola/plugins/compile/pandoc.py
parent5ec02211214350ee558fd9f6bb052264fd24f75e (diff)
Imported Upstream version 7.6.0upstream/7.6.0
Diffstat (limited to 'nikola/plugins/compile/pandoc.py')
-rw-r--r--nikola/plugins/compile/pandoc.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/nikola/plugins/compile/pandoc.py b/nikola/plugins/compile/pandoc.py
index ada8035..361f158 100644
--- a/nikola/plugins/compile/pandoc.py
+++ b/nikola/plugins/compile/pandoc.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2014 Roberto Alsina and others.
+# Copyright © 2012-2015 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -30,6 +30,8 @@ You will need, of course, to install pandoc
"""
+from __future__ import unicode_literals
+
import io
import os
import subprocess
@@ -42,11 +44,16 @@ class CompilePandoc(PageCompiler):
"""Compile markups into HTML using pandoc."""
name = "pandoc"
+ friendly_name = "pandoc"
+
+ def set_site(self, site):
+ self.config_dependencies = [str(site.config['PANDOC_OPTIONS'])]
+ super(CompilePandoc, self).set_site(site)
def compile_html(self, source, dest, is_two_file=True):
makedirs(os.path.dirname(dest))
try:
- subprocess.check_call(('pandoc', '-o', dest, source))
+ subprocess.check_call(['pandoc', '-o', dest, source] + self.site.config['PANDOC_OPTIONS'])
except OSError as e:
if e.strreror == 'No such file or directory':
req_missing(['pandoc'], 'build this site (compile with pandoc)', python=False)