Add HTML template placeholders for filename (#371)

This will e.g. enable users to replace the SVG diagram with PNG,
that is needed as a work-around when the SVG output from Graphviz
is not looking good. Suggested as work-around for Graphviz bug in
https://github.com/wireviz/WireViz/issues/175#issuecomment-2132206026
This commit is contained in:
KV 2024-05-26 17:28:09 +02:00
parent 2336231d3e
commit f474cddedb

View File

@ -81,6 +81,9 @@ def generate_html_output(
"<!-- %fontname% -->": options.fontname,
"<!-- %bgcolor% -->": wv_colors.translate_color(options.bgcolor, "hex"),
"<!-- %diagram% -->": svgdata,
# TODO: "<!-- %diagram_png_base64% -->": base64 of png file
"<!-- %filename% -->": str(filename),
"<!-- %filename_stem% -->": Path(filename).stem,
"<!-- %bom% -->": bom_html,
"<!-- %bom_reversed% -->": bom_html_reversed,
"<!-- %sheet_current% -->": "1", # TODO: handle multi-page documents