Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/wireviz/Harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,9 +726,6 @@ def output(
if "csv" in fmt:
# TODO: implement CSV output (preferably using CSV library)
sys.stderr.write("CSV output is not yet supported\n")
if "pdf" in fmt:
# TODO: implement PDF output
sys.stderr.write("PDF output is not yet supported\n")

if filename is None:
# stdout mode — emit each rendered format in the user-requested order
Expand Down Expand Up @@ -812,6 +809,9 @@ def _render(
png_bytes = graph.pipe(format="png")
outputs["png"] = png_bytes

if "pdf" in fmt:
outputs["pdf"] = graph.pipe(format="pdf")
Comment on lines +812 to +813

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The current implementation of PDF output only renders the Graphviz diagram. However, the docstring in src/wireviz/wireviz.py (line 55) states that the PDF format includes "the diagram and (depending on the template) the BOM".

Since this implementation only pipes the graph to PDF, the resulting file will miss the summary Bill of Materials (BOM) table that is present in the HTML output. To maintain consistency with the documentation, you should either update the docstring in wireviz.py to clarify that PDF only contains the diagram (consistent with PNG and SVG), or consider extending the implementation to include the BOM.


if "gv" in fmt:
outputs["gv"] = graph.source

Expand Down
2 changes: 1 addition & 1 deletion src/wireviz/wireviz.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def parse(
* "gv": the diagram, as a GraphViz source file
* "html": the diagram and (depending on the template) the BOM, as a HTML file
* "png": the diagram, as a PNG raster image
* "pdf": the diagram and (depending on the template) the BOM, as a PDF file
* "pdf": the diagram, as a PDF document (no BOM — see "html" for that)
* "svg": the diagram, as a SVG vector image
* "tsv": the BOM, as a tab-separated text file

Expand Down
2 changes: 1 addition & 1 deletion src/wireviz/wv_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"g": "gv",
"h": "html",
"p": "png",
# "P": "pdf",
"P": "pdf",
"s": "svg",
"t": "tsv",
}
Expand Down