Skip to content

Make HTML's html-dfn.js work#180

Merged
tobie merged 1 commit into
tobie:masterfrom
annevk:annevk/html-dfn
Jun 5, 2026
Merged

Make HTML's html-dfn.js work#180
tobie merged 1 commit into
tobie:masterfrom
annevk:annevk/html-dfn

Conversation

@annevk

@annevk annevk commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Corresponding HTML PR: whatwg/html#12523.

@annevk

annevk commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

@tobie let me know if this seems reasonable or if you'd approach this differently. (I used Claude to make this.)

@tobie

tobie commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Thanks for the PR. Could you explain what the intent is? I'm not sure I entirely understand the problem this is trying to solve. Admittedly, I haven't looked at that code base for a while.

@annevk

annevk commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

Oh oops. The HTML standard uses html-dfn.js to make back-references work. I.e., going from a dfn elements to all the places it is referenced. html-dfn.js relies on xrefs.json for that which is generated by Wattsi.

Then:

  1. Currently PR Preview does not copy over these files.
  2. The HTML standard assumes they are at / which does not work for PR Preview.

If we only fixed 2 we would not get back-references for newly-added definitions, which is why I'm attempting a fix here.

@tobie

tobie commented Jun 5, 2026

Copy link
Copy Markdown
Owner

What is the rationale for rewriting the file paths rather than making them relative?

@annevk

annevk commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

We use this for both single-page and multi-page. There's not a relative path that works for both. That's why I kept the logic in PR Preview. An alternative would be having PR Preview invoke Wattsi in a specific way perhaps and make that influence the output somehow. This seemed the most straightforward.

@tobie

tobie commented Jun 5, 2026

Copy link
Copy Markdown
Owner

This feels brittle and hacky, but as you’re the only consumer of the Wattsi codenpath, if you’re fine with it, I don’t have any objections.

@tobie tobie merged commit 36833ab into tobie:master Jun 5, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants