Template re-org

* Re-organized template structure
* Added default novel template
master
Dmytro Yeroshkin 12 months ago
parent e4f187e292
commit 8afddb7217

@ -0,0 +1 @@
recursive-include novel_compiler templates *.docx

@ -6,6 +6,7 @@ import tempfile
import MarkdownPP
import json
from lxml import etree
from importlib.resources import path
TITLE_MARKER = '# '
AUTHOR_MARKER = '### '
@ -123,8 +124,12 @@ def main():
)
arguments = parser.parse_args()
arguments.template.close()
doc = DocxTemplate(arguments.template.name)
if arguments.template:
arguments.template.close()
doc = DocxTemplate(arguments.template.name)
else:
with path('novel_compiler.templates', 'novel.docx') as novel_template:
doc = DocxTemplate(novel_template)
if arguments.pp:
mdfile = tempfile.TemporaryFile(mode='w+')
MarkdownPP.MarkdownPP(

Loading…
Cancel
Save