Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added support for custom Pandoc templates

Place a template in ~/.pandoc/templates/ and set "pandoc_template" in
the settings file to configure.
  • Loading branch information...
commit e035ead8e6b50219956f2ccc0fc70c0c533866f1 1 parent 27ad9a5
Daniel Shannon authored
Showing with 9 additions and 1 deletion.
  1. +3 −0  Markboard.py
  2. +6 −1 Markboard.sublime-settings
3  Markboard.py
View
@@ -153,6 +153,9 @@ def run(self):
outFile = f.name
f.close()
cmd = ['pandoc', self.myFilename, '--output=%s' % outFile, '--from=markdown', '--to=html', '--smart', '--normalize']
+ template = sublime.load_settings("Markboard.sublime-settings").get("pandoc_template", None)
+ if template != None and template != "":
+ cmd.append("--template=%s", template)
try:
subprocess.call(cmd, env=self.env)
except Exception as e:
7 Markboard.sublime-settings
View
@@ -7,6 +7,11 @@
// If you wish to use Pandoc, you should probably specify
// its installation path, as it's often not found by
// Sublime.
- "pandoc_path": "/usr/local/bin"
+ "pandoc_path": "/usr/local/bin",
+
+ // You can define a custom template by placing it in a
+ // directory where Pandoc will find it (e.g.,
+ // ~/.pandoc/templates/) and providing its filename here.
+ "pandoc_template": ""
}
Please sign in to comment.
Something went wrong with that request. Please try again.