Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete PDF output handler #367

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
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
Binary file added examples/demo01.pdf
Binary file not shown.
Binary file added examples/demo02.pdf
Binary file not shown.
Binary file added examples/ex01.pdf
Binary file not shown.
Binary file added examples/ex02.pdf
Binary file not shown.
Binary file added examples/ex03.pdf
Binary file not shown.
Binary file added examples/ex04.pdf
Binary file not shown.
Binary file added examples/ex05.pdf
Binary file not shown.
Binary file added examples/ex06.pdf
Binary file not shown.
Binary file added examples/ex07.pdf
Binary file not shown.
Binary file added examples/ex08.pdf
Binary file not shown.
Binary file added examples/ex09.pdf
Binary file not shown.
Binary file added examples/ex10.pdf
Binary file not shown.
Binary file added examples/ex11.pdf
Binary file not shown.
Binary file added examples/ex12.pdf
Binary file not shown.
Binary file added examples/ex13.pdf
Binary file not shown.
Binary file added examples/ex14.pdf
Binary file not shown.
8 changes: 4 additions & 4 deletions src/wireviz/Harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ def output(
).exists() # if SVG already exists, do not delete later
# graphical output
for f in fmt:
if f in ("png", "svg", "html"):
if f in ("png", "svg", "html", "pdf"):
if f == "html": # if HTML format is specified,
f = "svg" # generate SVG for embedding into HTML
# SVG file will be renamed/deleted later
Expand All @@ -707,9 +707,9 @@ def output(
if "html" in fmt:
generate_html_output(filename, bomlist, self.metadata, self.options)
# PDF output
if "pdf" in fmt:
# TODO: implement PDF output
print("PDF output is not yet supported")
#if "pdf" in fmt:
# # TODO: implement PDF output
# print("PDF output is not yet supported")
# delete SVG if not needed
if "html" in fmt and not "svg" in fmt:
# SVG file was just needed to generate HTML
Expand Down
4 changes: 2 additions & 2 deletions src/wireviz/build_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

input_extensions = [".yml"]
extensions_not_containing_graphviz_output = [".gv", ".bom.tsv"]
extensions_containing_graphviz_output = [".png", ".svg", ".html"]
extensions_containing_graphviz_output = [".png", ".svg", ".html", ".pdf"]
generated_extensions = (
extensions_not_containing_graphviz_output + extensions_containing_graphviz_output
)
Expand Down Expand Up @@ -64,7 +64,7 @@ def build_generated(groupkeys):
# collect and iterate input YAML files
for yaml_file in collect_filenames("Building", key, input_extensions):
print(f' "{yaml_file}"')
wireviz.parse(yaml_file, output_formats=("gv", "html", "png", "svg", "tsv"))
wireviz.parse(yaml_file, output_formats=("gv", "html", "png", "svg", "tsv", "pdf"))

if build_readme:
i = "".join(filter(str.isdigit, yaml_file.stem))
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
Binary file added tutorial/tutorial01.pdf
Binary file not shown.
Binary file added tutorial/tutorial02.pdf
Binary file not shown.
Binary file added tutorial/tutorial03.pdf
Binary file not shown.
Binary file added tutorial/tutorial04.pdf
Binary file not shown.
Binary file added tutorial/tutorial05.pdf
Binary file not shown.
Binary file added tutorial/tutorial06.pdf
Binary file not shown.
Binary file added tutorial/tutorial07.pdf
Binary file not shown.
Binary file added tutorial/tutorial08.pdf
Binary file not shown.
Loading