Template re-org
* Re-organized template structure * Added default novel template
This commit is contained in:
parent
e4f187e292
commit
8afddb7217
|
@ -0,0 +1 @@
|
||||||
|
recursive-include novel_compiler templates *.docx
|
|
@ -6,6 +6,7 @@ import tempfile
|
||||||
import MarkdownPP
|
import MarkdownPP
|
||||||
import json
|
import json
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
|
from importlib.resources import path
|
||||||
|
|
||||||
TITLE_MARKER = '# '
|
TITLE_MARKER = '# '
|
||||||
AUTHOR_MARKER = '### '
|
AUTHOR_MARKER = '### '
|
||||||
|
@ -123,8 +124,12 @@ def main():
|
||||||
)
|
)
|
||||||
arguments = parser.parse_args()
|
arguments = parser.parse_args()
|
||||||
|
|
||||||
arguments.template.close()
|
if arguments.template:
|
||||||
doc = DocxTemplate(arguments.template.name)
|
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:
|
if arguments.pp:
|
||||||
mdfile = tempfile.TemporaryFile(mode='w+')
|
mdfile = tempfile.TemporaryFile(mode='w+')
|
||||||
MarkdownPP.MarkdownPP(
|
MarkdownPP.MarkdownPP(
|
||||||
|
|
Loading…
Reference in New Issue