|
@ -48,14 +48,14 @@ doc = doc.walk(transform, context) |
|
|
# setting out to TeX |
|
|
# setting out to TeX |
|
|
doc.content = [Group(*doc.content, metadata={"language":language})] |
|
|
doc.content = [Group(*doc.content, metadata={"language":language})] |
|
|
|
|
|
|
|
|
# Initialize KaTeX client (this runs the node app and connects to a unix socket) |
|
|
|
|
|
katexClient = KatexClient() |
|
|
|
|
|
# Initialize the image processor (this just keeps some basic state) |
|
|
# Initialize the image processor (this just keeps some basic state) |
|
|
imageProcessor = ImageProcessor(args.img_public_dir, args.img_web_path, *args.img_lookup_dirs) |
|
|
imageProcessor = ImageProcessor(args.img_public_dir, args.img_web_path, *args.img_lookup_dirs) |
|
|
|
|
|
|
|
|
# Generate HTML and TeX out of the transformed document |
|
|
# Initialize KaTeX client (this runs the node app and connects to a unix socket) |
|
|
open(args.output_html, "w").write(html(doc, katexClient, imageProcessor)) |
|
|
with KatexClient() as katexClient: |
|
|
open(args.output_tex, "w").write(tex(doc, imageProcessor)) |
|
|
# Generate HTML and TeX out of the transformed document |
|
|
|
|
|
open(args.output_html, "w").write(html(doc, katexClient, imageProcessor)) |
|
|
|
|
|
open(args.output_tex, "w").write(tex(doc, imageProcessor)) |
|
|
|
|
|
|
|
|
if args.debug: |
|
|
if args.debug: |
|
|
print(show(doc)) |
|
|
print(show(doc)) |
|
|