-
Notifications
You must be signed in to change notification settings - Fork 71
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
Improve metadata generation #5033
Conversation
13a5218
to
e3b856b
Compare
Corrections I have made to the original idea:
|
e3b856b
to
f0f7347
Compare
I am using this PR to continue the efforts for the metadata improvements. |
f0f7347
to
ed9b870
Compare
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 overall, just one question:
I noticed that we are displaying maps differently in the docs files now -- before the values were wrapped inside <code>
while now they are inside a ul
. Are we sure we want to remove the code
tag?
@epetrow The reason the Before adding prettyValue for the map variables, we displayed the resolvedValue of each map, which is always resolved to string and is best visualized in an inline element - (1: (0 2px 3px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.12)), 2: (0 4px 6px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.12)), 3: (0 6px 8px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.12)) ...
After adding the prettyValue, we can iterate over each key/value pair and display that information separately for better multiline data visualization -
In terms of data tracking, there is no issue as both resolvedValue and prettyValue contain the same data. The only difference is that one is parsed with proper types, while the other is parsed as a string. These changes to the .md doc files should be checked in the sites that directly use them to ensure everything works properly. |
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.
I noticed a few inconsistencies in how the data is displayed in the docs files now. It might be expected, however now we have:
Numbers being displayed as numbers - e.g. thin: 100
If a value has a unit it is a string - xxs: "0.5rem"
Also in some places there are escape characters that are being displayed in the docs now - serif: "\"Times New Roman\",
4461de1
to
18f7ff2
Compare
@epetrow |
18f7ff2
to
fd07a25
Compare
The code is self-explanatory, but here is anyway: values are processed and prettified in that order
SassMap
, it's prettified as an object, with the values prettified recursively according to the rules hereby;SassList
, it's prettified as an array, with the items prettified according to the rules hereby;SassString
, it's prettified as string, with quotes removed where possible;SassNumber
, it's prettified as a number, if there are not units or string otherwise;SassBoolean
, it's prettified as boolean;SassNull
, it's prettified asnull
;The prettified value is then stored as a new
prettyValue
field invariables.json
, which is then copied tosassdoc-data.json
.