-
Notifications
You must be signed in to change notification settings - Fork 226
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
Add basic options and metadata #214
Conversation
kvid
commented
Feb 9, 2021
- Add metadata attributes: title, description, notes
- Add option attributes: color_mode, mini_bom_mode
- Use metadata values and a few more indents and linebreaks in the HTML output
- Translate color text according to options.color_mode a few more places
- This solves the initial part of [feature] Accept optional (and overridable) harness attribute(s) #158
fc47d4b
to
75a9a75
Compare
Does it make sense to keep the |
If you by this mean replacing the Metadata dataclass with a dict, then that is quite easy to do. The drawback is more complex syntax when using the values in the code.
The currently suggested code in this PR only use metadata for generating HTML.
|
For now, I would indeed request to replace the dataclass with a dict, to stay flexible, and try to improve syntax later. I don't see the more complex syntax as a big problem since it is used in a limited number of places. A different, but IMHO uglier option, is to keep a regular A wilder idea, which I would like to explore in a separate PR, is implementing dot notation for a dict. By creating a custom class like that, you could force it to have the standard attributes (
Just leaving this as an idea for the future. |
Resolves the basic part of wireviz#158.
Use this option value both in the graph and as font family in HTML.
The same color value is used for html.body.style.background-color and gv.graph.bgcolor to make the diagram fit seamlessly in the HTML output. "bgcolor" is chosen as option name to avoid the dash in the CSS name "background-color".
Bug: Node attribute fillcolor is ignored unless style contains filled. When cable nodes get an empty style (unless bundle), the node background color become equal to the graph background color as it was transparent. Fix: Make the style contain filled.
Bug: When the HTML label is narrow (e.g. connectors in tutorial01), then the white node background is wider, and when the HTML label is low (e.g. ferrules in tutorial05 and totorial06), then the white node background is taller. Such errors are easily seen with a non-white bgcolor. Fix: Set node width, height, and margin to zero to let the actual size of the node be entirely determined by the label.
It is default white unless set to a different color, or equal bgcolor (as if transparent) if set to ~, null, Null, or NULL.
And a few other changes requested in the same review. Co-authored-by: Daniel Rojas <github@danielrojas.net>
I have tried out the code, and it works well. I also have no issues with the code style itself. Would you mind adding the required documentation to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the syntax description!