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

Include links in idlparsed, css, etc. #642

Closed
gsnedders opened this issue Jun 24, 2022 · 4 comments
Closed

Include links in idlparsed, css, etc. #642

gsnedders opened this issue Jun 24, 2022 · 4 comments

Comments

@gsnedders
Copy link
Member

Currently you can derive links by processing the data in dfns, however this isn't possible if you're trying to only use npm-released data (especially in the css case—I'm aware there's no release of idlparsed).

For example, for a property, it would be nice if the URL to the definition was included within the data in css.

@meyerweb
Copy link
Member

meyerweb commented Jan 23, 2024

@gsnedders, are you suggesting something like the following, where the ID is stored in each property’s object? Or did you mean the whole URL?

{
  "spec": {
    "title": "CSS Table Module Level 3",
    "url": "https://drafts.csswg.org/css-tables-3/"
  },
  "properties": [
    {
      "id": "propdef-border-collapse",
      "name": "table-layout",
      "value": "auto | fixed",
      "initial": "auto",
      "appliesTo": "table grid boxes",
      "inherited": "no",
      "percentages": "n/a",
      "computedValue": "specified keyword",
      "canonicalOrder": "per grammar",
      "animationType": "discrete",
      "styleDeclaration": [
        "table-layout",
        "tableLayout"
      ]
    },
    {
…

@gsnedders
Copy link
Member Author

@gsnedders, are you suggesting something like the following, where the ID is stored in each property’s object? Or did you mean the whole URL?

Probably the whole URL, because we probably don't want everyone having to implement the logic of "how to construct a URL for this" (especially in the face of multipage specs).

tidoust added a commit to w3c/reffy that referenced this issue Jan 25, 2024
Requested in w3c/webref#642

It was possible to link entries in CSS extracts back to entries in the dfns
extract with a bit of logic but:
1. This requires having both CSS extracts and dfns extracts at hand, and the
dfns extracts typically aren't included in the `@webref/idl` package.
2. This is somewhat error-prone.

This updates the CSS definitions extraction logic to also extract the absolute
URL (with fragment) of the definition whenever possible. A slight change of
approach was needed as previous extraction logic handled "multi-definitions"
(e.g., a table definition that defines multiple properties at once) through a
text-based approach, and the code now also needs to track the IDs.

Tests already contained IDs, so this update merely refreshes the expected
results.
tidoust added a commit to w3c/reffy that referenced this issue Jan 29, 2024
Requested in w3c/webref#642

It was possible to link entries in CSS extracts back to entries in the dfns
extract with a bit of logic but:
1. This requires having both CSS extracts and dfns extracts at hand, and the
dfns extracts typically aren't included in the `@webref/idl` package.
2. This is somewhat error-prone.

This updates the CSS definitions extraction logic to also extract the absolute
URL (with fragment) of the definition whenever possible. A slight change of
approach was needed as previous extraction logic handled "multi-definitions"
(e.g., a table definition that defines multiple properties at once) through a
text-based approach, and the code now also needs to track the IDs.

Tests already contained IDs, so this update merely refreshes the expected
results.
@tidoust
Copy link
Member

tidoust commented Jan 31, 2024

Thanks for the nudge, that proved useful to push the issue to the top of the pile ;)

CSS extracts in Webref now include an href key for all entries (except ones that extend a base definition defined in another spec). Also deployed in the @webref/css package, starting with v6.11.0. Let me know if you spot any issue!

I'll look into doing the same thing for idlparsed extracts.

@tidoust
Copy link
Member

tidoust commented Feb 23, 2024

All extracts that didn't have more specific links back to the spec now have such links in href properties attached to most objects: CSS extracts, idlparsed extracts, and elements extracts. Other extracts had these links already (or cannot have them in the case of the idl extracts).

For idlparsed extracts, some entries don't have links, usually because the spec does not have the appropriate definitions, see w3c/reffy#1493 for details.

Closing the issue as addressed.

@tidoust tidoust closed this as completed Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants