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

Replace manual spec tables with specifications macro #13126

Closed
queengooborg opened this issue Feb 19, 2022 · 7 comments
Closed

Replace manual spec tables with specifications macro #13126

queengooborg opened this issue Feb 19, 2022 · 7 comments
Assignees
Labels
bulk update An update to a mass amount of data, or scripts/linters related to such changes good first issue A good issue for newcomers to get started with.

Comments

@queengooborg
Copy link
Collaborator

queengooborg commented Feb 19, 2022

Now that mdn/yari#5284 has landed, we can take advantage of the {{Specifications}} macro for entries that are not present in BCD. We should convert all of our spec tables to the macro, either by linking to BCD where able or adding the spec-urls key to the page metadata.

Breakdown of all files seemingly containing a manual spec table (found with rg -i '\| Specification|Specification', last updated May 14, 2022):
  • /files/en-us/glossary/alpn/index.md
  • /files/en-us/mdn/kitchensink/index.md
  • /files/en-us/mdn/structures/page_types/aria_page_template/index.md
  • /files/en-us/web/media/formats/containers/index.md
  • /files/en-us/web/api/performance_api/index.md
  • /files/en-us/web/api/css_object_model/index.md
  • /files/en-us/web/api/web_storage_api/index.md
  • /files/en-us/web/api/server-sent_events/index.md
  • /files/en-us/web/api/page_visibility_api/index.md
  • /files/en-us/web/api/svg_api/index.md
  • /files/en-us/web/api/web_speech_api/index.md
  • /files/en-us/web/api/decompressionstream/writable/index.md
  • /files/en-us/web/api/sensor_apis/index.md
  • /files/en-us/web/api/web_animations_api/index.md
  • /files/en-us/web/api/pointer_lock_api/index.md
  • /files/en-us/web/api/screen_capture_api/index.md
  • /files/en-us/web/api/url_api/index.md
  • /files/en-us/web/api/vibration_api/index.md
  • /files/en-us/web/api/web_periodic_background_synchronization_api/index.md
  • /files/en-us/web/api/notifications_api/index.md
  • /files/en-us/web/api/storage_api/index.md
  • /files/en-us/web/api/resource_timing_api/index.md
  • /files/en-us/web/api/push_api/index.md
  • /files/en-us/web/api/payment_request_api/index.md
  • /files/en-us/web/api/web_midi_api/index.md
  • /files/en-us/web/api/webrtc_statistics_api/index.md
  • /files/en-us/web/api/websockets_api/index.md
  • /files/en-us/web/api/permissions_api/index.md
  • /files/en-us/web/api/subtlecrypto/digest/index.md
  • /files/en-us/web/api/screen_wake_lock_api/index.md
  • /files/en-us/web/api/presentation_api/index.md
  • /files/en-us/web/api/picture-in-picture_api/index.md
  • /files/en-us/web/api/webgl_api/index.md
  • /files/en-us/web/api/streams_api/index.md
  • /files/en-us/web/api/web_nfc_api/index.md
  • /files/en-us/web/api/document_object_model/index.md
  • /files/en-us/web/api/document_object_model/introduction/index.md
  • /files/en-us/web/api/pointer_events/index.md
  • /files/en-us/web/api/barcode_detection_api/index.md
  • /files/en-us/web/api/indexeddb_api/index.md
  • /files/en-us/web/api/webotp_api/index.md
  • /files/en-us/web/api/reporting_api/index.md
  • /files/en-us/web/api/web_workers_api/index.md
  • /files/en-us/web/api/web_authentication_api/index.md
  • /files/en-us/web/api/navigation_timing_api/index.md
  • /files/en-us/web/api/performance_timeline/index.md
  • /files/en-us/web/api/webrtc_api/index.md
  • /files/en-us/web/api/web_crypto_api/index.md
  • /files/en-us/web/api/webvtt_api/index.md
  • /files/en-us/web/api/service_worker_api/index.md
  • /files/en-us/web/api/background_fetch_api/index.md
  • /files/en-us/web/http/network_error_logging/index.md
  • /files/en-us/web/http/headers/accept-post/index.md
  • /files/en-us/web/http/headers/sourcemap/index.md
  • /files/en-us/web/http/headers/expect-ct/index.md
  • /files/en-us/web/http/headers/proxy-authorization/index.md
  • /files/en-us/web/http/resources_and_specifications/index.md
  • /files/en-us/web/manifest/index.md
  • /files/en-us/web/security/certificate_transparency/index.md
  • /files/en-us/web/css/color_value/color_keywords/index.md
  • /files/en-us/web/css/custom-ident/index.md
  • /files/en-us/web/css/ident/index.md
@github-actions github-actions bot added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Feb 19, 2022
@queengooborg queengooborg added the bulk update An update to a mass amount of data, or scripts/linters related to such changes label Feb 19, 2022
@hamishwillee
Copy link
Collaborator

hamishwillee commented Feb 20, 2022

I'll help with this, but not until mdn/yari#5284 (comment) is answered. We probably need to make it clear that BCD is still the desired option, if possible.

@sideshowbarker sideshowbarker self-assigned this Feb 21, 2022
@sideshowbarker sideshowbarker removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Feb 21, 2022
@sideshowbarker
Copy link
Collaborator

sideshowbarker commented Feb 21, 2022

This weekend I played around with automating this, and I have a reproducible working solution — based on a hack to the https://github.com/mdn/yari/blob/main/markdown/cli.ts source.

So I’ve gone ahead and assigned this to myself as a heads-up to preempt duplication of effort.

One side effect of the automation is that it causes redundant spaces to get reduced to a single space. I think that’s an expected consequence of the fact that what I’m doing is, first running yari md m2h to generate temporary .html files from the .md sources, and then running yari md h2m — with my hack in place — to replace the .md source with the output containing the spec-urls frontmatter key, and the specifications table replaced with {{Specifications}}.

In other words, it’s .md.html.md round-tripping the sources — and so any redundant spaces kind of expectedly get eaten during the initial .md.html conversion (because the extra spaces anyway don’t get rendered in HTML output).

I guess it’s not a bad thing to zap all those extra spaces — but the problem is, it makes it harder to wade through the diffs to review the actual spec-urls-frontmatter-key-plus-{{Specifications}} change we actually care about.

So I think, to create the PRs, I’ll do some that first just make the whitespace changes — and then after those are merged, I can run the conversion that’ll give us just the spec-urls-frontmatter-key-plus-{{Specifications}} changes to review.

@sideshowbarker
Copy link
Collaborator

So I think, to create the PRs, I’ll do some that first just make the whitespace changes — and then after those are merged, I can run the conversion that’ll give us just the spec-urls-frontmatter-key-plus-{{Specifications}} changes to review.

Nevermind – after spending some more time thinking about it, I realized I could do some git gymnastics: the first commit with the unrelated (whitespace, etc.) changes, and then a second commit with the actual spec-URL changes we care about — and then rebasing and deleting the first commit. #13170 is the result.

So at this point, I’ll stop and write up the steps I used for doing the conversion, and clean up my https://github.com/mdn/yari/blob/main/markdown/cli.ts hack and open a yari PR with the patch — not because we’ll necessarily want to ever merge that into yari, but instead so that anybody else interested could try it out locally themselves.

@sideshowbarker
Copy link
Collaborator

mdn/yari#5309 has the modification I made to the h2m command-line tool.

@teoli2003
Copy link
Contributor

Note that web/http has a lot of Unknown specification due to RFCs not in browser-specs (and some are Webdav).

@sideshowbarker
Copy link
Collaborator

Note that web/http has a lot of Unknown specification due to RFCs not in browser-specs (and some are Webdav).

Yup — see my comment over at #13170 (comment). I think this part may be pretty easy to solve. Anyway, I’ll soon have something we can try out for it, at least.

sideshowbarker added a commit that referenced this issue Feb 24, 2022
sideshowbarker added a commit that referenced this issue Feb 24, 2022
sideshowbarker added a commit that referenced this issue Feb 24, 2022
sideshowbarker added a commit that referenced this issue Feb 25, 2022
sideshowbarker added a commit that referenced this issue Feb 25, 2022
sideshowbarker added a commit that referenced this issue Feb 25, 2022
teoli2003 pushed a commit that referenced this issue Feb 25, 2022
sideshowbarker added a commit to sideshowbarker/browser-compat-data that referenced this issue Feb 25, 2022
sideshowbarker added a commit to sideshowbarker/browser-compat-data that referenced this issue Feb 25, 2022
sideshowbarker added a commit that referenced this issue Feb 28, 2022
sideshowbarker added a commit that referenced this issue May 12, 2022
sideshowbarker added a commit that referenced this issue May 12, 2022
@queengooborg queengooborg added the good first issue A good issue for newcomers to get started with. label May 13, 2022
sideshowbarker added a commit that referenced this issue May 13, 2022
sideshowbarker added a commit that referenced this issue May 13, 2022
sideshowbarker added a commit that referenced this issue May 13, 2022
sideshowbarker added a commit that referenced this issue May 13, 2022
sideshowbarker added a commit that referenced this issue May 13, 2022
sideshowbarker added a commit that referenced this issue May 13, 2022
sideshowbarker added a commit that referenced this issue May 13, 2022
sideshowbarker added a commit that referenced this issue May 13, 2022
teoli2003 pushed a commit that referenced this issue May 13, 2022
* Add spec URLs for the web/http subtree

Part of #13126

* Fix some cases that should be using the browser-compat frontmatter key

* Add some missing RFCs to SpecData.json

Previously we didn’t need these in SpecData.json because the RFC macro
doesn’t actually do any title lookup.
queengooborg pushed a commit that referenced this issue May 13, 2022
* Add spec URLs for the web/svg subtree

Part of #13126

* Drop browser-compat for SVG cases not actually in BCD; add spec-urls instead

* Fix browser-compat for “by”, “spreadMethod” & “vector-effect”

Related: mdn/browser-compat-data#15141
sideshowbarker added a commit that referenced this issue May 14, 2022
sideshowbarker added a commit that referenced this issue May 14, 2022
queengooborg pushed a commit that referenced this issue May 14, 2022
* Add spec URLs for web/accessibility subtree

Part of #13126

* Add the Living version of ARIA Authoring Practices to SpecData.json

Otherwise, without this change, the spec-urls values being added for the
ARIA Authoring Practices guide get shown with “Unknown specification” in
output.
hamishwillee pushed a commit to hamishwillee/content that referenced this issue May 23, 2022
* Add spec URLs for the web/http subtree

Part of mdn#13126

* Fix some cases that should be using the browser-compat frontmatter key

* Add some missing RFCs to SpecData.json

Previously we didn’t need these in SpecData.json because the RFC macro
doesn’t actually do any title lookup.
hamishwillee pushed a commit to hamishwillee/content that referenced this issue May 23, 2022
* Add spec URLs for the web/svg subtree

Part of mdn#13126

* Drop browser-compat for SVG cases not actually in BCD; add spec-urls instead

* Fix browser-compat for “by”, “spreadMethod” & “vector-effect”

Related: mdn/browser-compat-data#15141
hamishwillee pushed a commit to hamishwillee/content that referenced this issue May 23, 2022
hamishwillee pushed a commit to hamishwillee/content that referenced this issue May 23, 2022
* Add spec URLs for web/accessibility subtree

Part of mdn#13126

* Add the Living version of ARIA Authoring Practices to SpecData.json

Otherwise, without this change, the spec-urls values being added for the
ARIA Authoring Practices guide get shown with “Unknown specification” in
output.
@sideshowbarker
Copy link
Collaborator

As far as I can tell, this is completed. But if I’ve missed anything, please let me know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bulk update An update to a mass amount of data, or scripts/linters related to such changes good first issue A good issue for newcomers to get started with.
Projects
Status: Done
Development

No branches or pull requests

4 participants