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

[feature] Accept a single string as image value #292

Open
kvid opened this issue Aug 28, 2022 · 0 comments · May be fixed by #416
Open

[feature] Accept a single string as image value #292

kvid opened this issue Aug 28, 2022 · 0 comments · May be fixed by #416

Comments

@kvid
Copy link
Collaborator

kvid commented Aug 28, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant