WireViz
WireViz copied to clipboard
[feature] Accept a single string as image value
I suggest we accept specifying an image attribute with a single string value as an optional syntax in addition to the current syntax. Often, only the single mandatory src attribute of an image is needed, and then it's shorter to just specify this string value to the image attribute directly.
connectors:
X1:
...
image: "Resources/my_connector.png"
This might also be a more intuitive syntax for beginners, and would have helped in use cases like #281.
It's quite easy to implement this in a method to the Image dataclass.
There might also be other dict attributes that could benefit of such an alternative syntax, like in additional_components and additional_bom_items.