WireViz icon indicating copy to clipboard operation
WireViz copied to clipboard

[feature] Accept a single string as image value

Open kvid opened this issue 3 years ago • 0 comments

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.

kvid avatar Aug 28 '22 14:08 kvid