(css-info-db) Replace CSS info pages by JSON DB

RESOLVED FIXED

Status

P2
enhancement
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: sebo, Assigned: sebo)

Tracking

(Blocks: 1 bug)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Updated

3 years ago
Summary: (CSS info DB) Replace CSS info pages by JSON DB → (css-info-db) Replace CSS info pages by JSON DB
(Assignee)

Updated

3 years ago
Depends on: 1198954
(Assignee)

Updated

3 years ago
Depends on: 1198962
(Assignee)

Updated

3 years ago
Depends on: 1198963
(Assignee)

Updated

3 years ago
Status: NEW → ASSIGNED
(Assignee)

Updated

3 years ago
Blocks: 1199204
(Assignee)

Updated

3 years ago
Blocks: 1200101
(Assignee)

Comment 1

3 years ago
All English sites now use 'cssinfo' and 'csssyntax2'. (Well, the latter can't be said with certainty due to bug 1180144.)

Jean-Yves, should I also replace 'cssbox' and 'csssyntax' on translated pages? There are around 400 pages for each of them.

Sebastian
Flags: needinfo?(jypenator)
Yes, I have started this for German CSS pages today and also made some minor tweaks to cssinfo. I am only able to help with this as a side project, though. With CSSRef, cssinfo, csssyntax, these pages are much more usable. Our international readers will appreciate it.
Flags: needinfo?(jypenator)
(Assignee)

Comment 3

3 years ago
Saw that. Thank you for the help, Florian! So I'll work on that, too.

Sebastian
Yes, I will do the fr ones over the week-end.
(Assignee)

Comment 5

3 years ago
Another question: Should I replace the contents of the 'csssyntax' template now by the one from 'csssyntax2'? That would save us a lot of work (not having to change the articles to 'csssyntax2' and possibly later on change them back to 'csssyntax').

Sebastian
Flags: needinfo?(jypenator)
(Assignee)

Comment 6

3 years ago
There are currently 284 pages remaining for 'cssbox' => 'cssinfo', almost all of them in fr, ja and zh-CN.
I can work on ja and zh-CN. Or should we reach out to the related translation communities to ask for help?

Sebastian
I think you should copy it into csssyntax. (and csssyntax2 should just call csssyntax)
Flags: needinfo?(jypenator)
Ziyunfei, do you think you can help us with zh-CN update?
Flags: needinfo?(446240525)
(Assignee)

Comment 9

3 years ago
(In reply to Jean-Yves Perrier [:teoli] from comment #7)
> I think you should copy it into csssyntax. (and csssyntax2 should just call
> csssyntax)

Done. So from now on it's 'cssinfo' and 'csssyntax' we should use.

(In reply to Jean-Yves Perrier [:teoli] from comment #8)
> Ziyunfei, do you think you can help us with zh-CN update?

For clarification, the {{cssbox(...)}} macro in the pages listed at https://developer.mozilla.org/zh-CN/search?locale=zh-CN&kumascript_macros=cssbox needs to be replaced by {{cssinfo}}.

Sebastian
(Assignee)

Comment 10

3 years ago
Sorry for needinfo'ing you again, Jean-Yves, but one big question that still needs clarification is how we translate the information stored in CSSData.

Before we had the translations partly stored within the info pages[1] and partly within the different templates used by those pages.

How should that information be stored now?

Sebastian

[1] E.g. https://developer.mozilla.org/ja/docs/Web/CSS/CSS_values_serialization
Flags: needinfo?(jypenator)
(Assignee)

Comment 11

3 years ago
Created attachment 8668424 [details]
Example for tightened up JSON DB including translations

Here's a suggestion for how the structure of the JSON DB could be changed in order to tighten it up and allow translations:

remove 'shorthand' (will be determined by one of the other properties being an array)
remove 'longhands' (other properties will hold arrays of longhands instead)
'order' is always set, a keyword (like 'asSpecified') will be used for 'as specified' values
'media', 'animatable', 'percentages', 'initial', 'appliesto', 'computed' and 'order' take either a keyword(s), an object of translated strings or an array of longhands in case of a shorthand

Open question:
Should 'animatable', 'percentages' and 'order' only be set when their value is different to 'no' resp. 'asSpecified'?

An example JSON including those changes is attached.

Jean-Yves, Florian, is this new structure ok for you?
If I don't get feedback from you both until Sunday, I'll start working on adjusting the scraper to return the new structure including translations.

Sebastian
Flags: needinfo?(fscholz)
(Assignee)

Comment 12

3 years ago
Created attachment 8668428 [details]
Example for tightened up JSON DB including translations

Sorry, attached the wrong file. Here's the right one.

Sebastian
Attachment #8668424 - Attachment is obsolete: true
This plan sounds good to me for now. I would like to see a separation between localization strings and data, but I don't have an idea how to do this best in this case at the moment.

In my brave new macro world of MDN, there are Data:xxx macros and L10n:yyy macros besides "normal" scripts (that contain neither data nor l10n). So, this now mixes Data and L10n.
Flags: needinfo?(fscholz)
(Assignee)

Comment 14

3 years ago
(In reply to Florian Scholz [:fscholz] from comment #13)
> This plan sounds good to me for now. I would like to see a separation
> between localization strings and data, but I don't have an idea how to do
> this best in this case at the moment.

Thanks for the quick response!

> In my brave new macro world of MDN, there are Data:xxx macros and L10n:yyy
> macros besides "normal" scripts (that contain neither data nor l10n). So,
> this now mixes Data and L10n.

Yes, I totally agree that data should be separated from l10n (and I love the idea of Data:xxx and L10n:yyy macros). Though separating those to can be done in a follow-up where we can discuss how to do that.

Sebastian
(Assignee)

Comment 15

3 years ago
As I didn't hear negative feedback, I started working on the structure described in comment 11.

It requires to update the CSS Data Scraper[1] to generate the new structure and the cssinfo template to be changed to use it.
With those changes in place it should be possible to exactly recreate the output from the old cssbox template in other languages. This will allow me to replace it on the fr, zh-CN and ja pages.

Sebastian

[1] https://github.com/SebastianZ/cssDataScraper
Flags: needinfo?(jypenator)
Flags: needinfo?(446240525)
(Assignee)

Comment 16

3 years ago
I finished adjusting the CSS Data Scraper and the cssinfo template yesterday. I ended up using a slightly different JSON structure in regard of 'animatable' information, otherwise it basically stayed the same.

The task still left is to replace the cssbox template on the remaining pages by the cssinfo template, which I'll do now.
Any remaining issues will be fixed by me on-the-fly. If you see any problems regarding the new CSSData structure or the output of the templates using it, please let me know.

Sebastian
(Assignee)

Comment 17

3 years ago
I just finished replacing all occurrences of the cssbox template by cssinfo.
By that we can finally close this issue.

Sebastian
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
(Assignee)

Updated

3 years ago
Blocks: 1216091
You need to log in before you can comment on or make changes to this bug.