feat: added html output

This commit is contained in:
Ferrari Martino Giordano
2024-03-20 12:28:42 +01:00
parent 9e56ab4e27
commit d5e129c057
+8 -4
View File
@@ -73,11 +73,15 @@ def document(fname, args, config):
if obj["Class"] == "StateMachine": if obj["Class"] == "StateMachine":
mddoc += f'\n## State-Machine "{label[1:]}"' mddoc += f'\n## State-Machine "{label[1:]}"'
fpath = os.path.join(doc.path(), f"{fname}.md") fpath = os.path.join(doc.path(), f"{fname}.md")
pdfpath = os.path.join(doc.path(), f"{fname}.pdf") outpath = os.path.join(doc.path(), fname)
logging.info("Writing markdown...") logging.info(f"Saving markdown: {fpath}")
with open(fpath, "w") as file: with open(fpath, "w") as file:
file.write(mddoc) file.write(mddoc)
logging.info("Generating pdf...") logging.info(f"Generating html: {outpath}.html")
os.system( os.system(
f"pandoc -H pandoc/disable_float.tex --resource-path={doc.path()} -s {fpath} -o {pdfpath}" f"pandoc --css styling.css --resource-path={doc.path()} --embed-resource --to html5 -s {fpath} -o {outpath}.html"
)
logging.info(f"Generating pdf: {outpath}.pdf")
os.system(
f"pandoc -H pandoc/disable_float.tex --resource-path={doc.path()} -s {fpath} -o {outpath}.pdf"
) )