|
@ -33,7 +33,7 @@ def main(): |
|
|
# just connect to an existing one. For formátíking many files in a row. |
|
|
# just connect to an existing one. For formátíking many files in a row. |
|
|
|
|
|
|
|
|
# Use panflute to parse the input MD file |
|
|
# Use panflute to parse the input MD file |
|
|
doc1 = import_md(open(args.input_filename, "r").read()) |
|
|
#doc1 = import_md(open(args.input_filename, "r").read()) |
|
|
doc2 = import_md(open(args.input_filename, "r").read()) |
|
|
doc2 = import_md(open(args.input_filename, "r").read()) |
|
|
|
|
|
|
|
|
if args.debug: |
|
|
if args.debug: |
|
@ -41,15 +41,15 @@ def main(): |
|
|
|
|
|
|
|
|
# The language metadatum is important, so it's read before transformation and |
|
|
# The language metadatum is important, so it's read before transformation and |
|
|
# then attached to a group inside the Doc |
|
|
# then attached to a group inside the Doc |
|
|
language = doc1.get_metadata("lang", None, True) |
|
|
#language = doc1.get_metadata("lang", None, True) |
|
|
context = Context(doc1, args.input_filename) |
|
|
#context = Context(doc1, args.input_filename) |
|
|
|
|
|
|
|
|
# Transform the document. This includes all the fancy formatting this software does. |
|
|
# Transform the document. This includes all the fancy formatting this software does. |
|
|
doc1 = doc1.walk(transform, context) |
|
|
#doc1 = doc1.walk(transform, context) |
|
|
|
|
|
|
|
|
# Now wrap the document contents in a group, which is able to pop its language |
|
|
# Now wrap the document contents in a group, which is able to pop its language |
|
|
# setting out to TeX |
|
|
# setting out to TeX |
|
|
doc1.content = [BlockGroup(*doc1.content, context=context, metadata={"lang":language})] |
|
|
#doc1.content = [BlockGroup(*doc1.content, context=context, metadata={"lang":language})] |
|
|
|
|
|
|
|
|
doc2 = TransformProcessor(args.input_filename).transform(doc2) |
|
|
doc2 = TransformProcessor(args.input_filename).transform(doc2) |
|
|
|
|
|
|
|
|