-
Notifications
You must be signed in to change notification settings - Fork 43
Add stylesheet. #3409
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 stylesheet. #3409
Conversation
maltelenz
left a comment
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.
My assumption would be that tools have their own styling on the kinds of things listed in the current proposal, and any user attempt to write a tool-independent stylesheet to enforce their styling on tool generated content would result in a mess. Most users would also not be expected to have all tools on the market, so they can't even see what their changes will result in, once mixed up with the tool-dependent styling.
I think we should go the other way: The user can give a stylesheet, which will be applied to the thing they write in the info and revisions fields. We reserve some css class and/or id prefix for tool usage, that users should avoid. This way, the tool styling of the autogenerated "stuff around" will not interfere with user content and styling.
|
Ok, removed those tags. |
|
What do you think about the remainder of my comment, reserving some class/id prefix for tool use, and explicitly saying that the |
For the first I think we need to consider it more and I'm not sure if needed, so I would prefer you make a separate PR for that. |
How else would a tool separate styling on their own generated content from the user-provided content?
How about:
|
Well, I don't know and would prefer to see a concrete proposal for that.
I added something like that. |
Here is a concrete proposal:
Not sure how to best place this information so one can find it when reading about the I did just realize this doesn't solve everything, since users can still do: which would destroy any vendor-generated content in Maybe more thought and discussion is needed. Edit: Maybe if we restrict the CSS to only allow class and id selectors, in addition to the reserved things above... |
|
My knowledge on HTML and CSS is very old, so if we have anyone with more knowledge that can contribute, that would be great! One approach would be to require that the user provided stylesheet prefixes each of its rules with a specified Tool generates this (pseudo-code): and the user provided stylesheet is required to prefix all of its selectors with the id: |
I haven't studied it recently either, and I think that's another reason to delay adding those details, and just accept the current PR until then. |
|
I don't think we should open pandoras box by just accepting a wholesale stylesheet, since we know that it opens up for way to much flexibility that can't be handled in a good way by tools or users. We need a clearly defined border that limits the user provided stylesheet effects to the user provided HTML contents, so that at least a well meaning user knows what to put in the stylesheet so it won't destroy anything. |
|
Language group: |
|
The issues to decide on are:
|
That seems to require that tools do something specific with the generated contents, and that users must know both what the tool does and their own contents - that seems quite complicated. Why not just add the following as documentation in the class: and then have style.css as follows: We could still say that the ids/classes should conform to some guide. (Yes, that works in Dymola - for the definition of works that doesn't consider readability.) |
|
@HansOlsson sounds similar to my previous proposal in a comment above? Quoted the relevant parts here for convenience:
|
Good, but some minor notes. I was not sure if that vendor part was how it was normally done in CSS; and looking at https://www.w3.org/TR/CSS22/syndata.html#vendor-keywords I'm still unsure, but my conclusion is that we shouldn't use exactly that.
Added: The second option seems safer, and/or we could tell library writers to have some prefix for their ids. |
|
That is some good digging, I wasn't aware of the CSS vendor concept. I agree we should avoid the underscore, we probably don't count as a vendor in the CSS-sense. Reserving a prefix for Modelica vendors is probably better than forcing library developers to use a prefix. After all, vendors only need to work with their generated content occasionally, library vendors do that much more often.
Or |
On the other hand it may make sense to mix documentation from different libraries when building combined models, and in that case there might be a benefit. Whereas combining the documentation from multiple tools in one document seem less useful.
I think |
|
Looking at the list of CSS selectors here, maybe something like this?
|
|
To discuss:
|
I very strongly think not. How would users know what they are doing, since they probably don't have all tools available to look at the effects? Each vendor can use vendor annotations to override their specific tool-generated content if they want to offer this feature. |
I think it should be reformulated as follows:
|
Sure, that works together with my suggestion:
|
|
This should now be updated. |
|
Phone meeting:
|
All of that is now handled. |
henrikt-ma
left a comment
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.
My primary concern is about how we use the record style definition of the annotation syntax when there could be both a single string and an array of strings. In the long run, I think we'll be happier if making the array case the primary one, and just describe the single string case as a syntactic sugar for an array with a single element. This means that the rest of the text can be written as if there was always an array, rather than describing the array as something exceptional.
Co-authored-by: Henrik Tidefelt <[email protected]>
Co-authored-by: Henrik Tidefelt <[email protected]>
I have done that, even if I don't think it makes it clearer and easier to understand. |
henrikt-ma
left a comment
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.
Looks good to me, and in agreement with #3409 (comment).
Closes #1893
I understand that the suggested names could be changed, or even removed from the proposal.
However, Dymola has used them for quite some time - and I believe they are used in some libraries.