Template re-org
* Re-organized template structure * Added default novel template
This commit is contained in:
parent
e4f187e292
commit
8afddb7217
1
MANIFEST.in
Normal file
1
MANIFEST.in
Normal file
@ -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(
|
||||
|
0
novel_compiler/templates/__init__.py
Normal file
0
novel_compiler/templates/__init__.py
Normal file
Loading…
x
Reference in New Issue
Block a user