|
|
|
@ -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(
|
|
|
|
|