manuskript/manuskript/exporter/pandoc.py

44 lines
1.1 KiB
Python
Raw Normal View History

2016-04-02 06:01:27 +13:00
#!/usr/bin/env python
# --!-- coding: utf8 --!--
from manuskript.exporter.basic import basicExporter, basicFormat
class HTMLFormat(basicFormat):
name = "HTML"
description = "A little known format modestly used. You know, web sites for example."
implemented = False
requires = {
"Settings": True,
2016-04-06 03:21:07 +12:00
"Preview": True,
2016-04-02 06:01:27 +13:00
}
class pandocExporter(basicExporter):
name = "Pandoc"
description = """<p>A universal document convertor. Can be used to convert markdown to a wide range of other
formats.</p>
<p>Website: <a href="http://www.pandoc.org">http://pandoc.org/</a></p>
"""
exportTo = [
HTMLFormat,
basicFormat("ePub", "Books that don't kill trees."),
2016-04-03 00:00:19 +13:00
basicFormat("OpenDocument", "OpenDocument format. Used by LibreOffice for example."),
2016-04-02 06:01:27 +13:00
basicFormat("PDF", "Needs latex to be installed."),
basicFormat("DocX", "Microsoft Office (.docx) document."),
2016-04-06 03:21:07 +12:00
basicFormat("reST"),
2016-04-02 06:01:27 +13:00
]
cmd = "pandoc"
@classmethod
def version(cls):
if cls.isValid():
r = cls.run(["-v"])
return r.split("\n")[0]
else:
return ""