You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you can see the fileout variable that is created based on the output argument is used to prepend to the image src parameter. This means if you provide an output location the image path in the YAML file needs to point to the image as if it is in the output directory.
I believe this is a bug and the fix is to instead pass the filein variable to create the context for finding the image since it makes logical sense that you will put the path to an image relative to where the YAML file lives.
For context I have a repo containing multiple subdirectories all with various YAML files and a single output/ directory that mirrors the source directory hierarchy but only contains the files generated by wireviz. To use the images I would have to add a relative path to the yaml file that would make no sense from a human-readable standpoint.
The better issue to look at is #189 as it seems to be the first issue addressing the image path problem. That issue notes that the branch bugfix/image-src contains the fix to this problem as well as additional features (notably that it embeds images within the SVG and HTML output files).
Hopefully this branch gets merged at some point and makes it into a release version.
wireviz version 0.3.2
python version 3.9.13
I discovered that the image path placed in the YAML file, e.g.
is relative to the output directory because of this line:https://github.com/formatc1702/WireViz/blob/b0d0070f08247e132b11bf45e617da9e8e1881f1/src/wireviz/wireviz.py#L62
As you can see the
fileout
variable that is created based on theoutput
argument is used to prepend to the image src parameter. This means if you provide an output location the image path in the YAML file needs to point to the image as if it is in the output directory.I believe this is a bug and the fix is to instead pass the
filein
variable to create the context for finding the image since it makes logical sense that you will put the path to an image relative to where the YAML file lives.For context I have a repo containing multiple subdirectories all with various YAML files and a single
output/
directory that mirrors the source directory hierarchy but only contains the files generated by wireviz. To use the images I would have to add a relative path to the yaml file that would make no sense from a human-readable standpoint.The text was updated successfully, but these errors were encountered: