WireViz
WireViz copied to clipboard
[feature] ability to import external yaml files for sharing connector and cable definitions
I would love to be able to have all my connector definitions in a single file and include it into my cable drawing yamls. This would allow for things like a shared "library" of connectors that can be shared across a company.
From my searches online there are ways to do this with pyyaml:
- https://stackoverflow.com/questions/528281/how-can-i-include-a-yaml-file-inside-another
- https://gist.github.com/joshbode/569627ced3076931b02f
- https://pypi.org/project/pyyaml-include/
I tried adding this code to the wireviz.py dev build but keep running into yaml syntax errors. My knowledge of yaml parsing is pretty limited.
Thank you for your effort, but please also try including your library using the existing command line option --prepend-file. Does that solve your issue? If not, please describe use cases where more or different features are required.
oops, should have read the docs better. Thanks this does the trick!
Hmm I'm going to re-open this because the --prepend-file leaves something to be desired. Ideally you would be able to keep common connector and cable definitions in a separate folder and point to it. But doing this breaks paths to image files referenced by the definitions.
Hmm I'm going to re-open this because the
--prepend-fileleaves something to be desired. Ideally you would be able to keep common connector and cable definitions in a separate folder and point to it. But doing this breaks paths to image files referenced by the definitions.
The PR #189 already implements relative image paths differently, but your use case is still an issue and I describe the root cause in https://github.com/formatc1702/WireViz/pull/189#discussion_r593457127.
There has been some progress in #189 regarding this issue, @gmkado please have a look and feel free to post feedback.
What about having something like this:
templates:
includes:
- includes/DB9.yaml
- includes/molex.yaml
- include/inline_headers.yaml
This would make it explicit that this specific harness file depends on a list of "libraries"
Thanks for your work on this tool! It's really great at making harness drawings more efficient!