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

Missing HTML heading defined thing #114

Closed
marcoscaceres opened this issue Mar 3, 2021 · 9 comments
Closed

Missing HTML heading defined thing #114

marcoscaceres opened this issue Mar 3, 2021 · 9 comments

Comments

@marcoscaceres
Copy link
Member

marcoscaceres commented Mar 3, 2021

With the ol' Shepherd data, it was possible to reference, for example, [=link type "manifest"=] - which is defined in the HTML spec in a H5 (and exported).

As such, right now, I've got a bunch of broken links over in the Web Manifest spec that are trying to link to [=link type "manifest"=]. I'm wondering how we should deal with those?

  • add support for headings as definitions in Webref?
  • fix the HTML spec to add <dfn data-export="">?
  • Something else?
@marcoscaceres
Copy link
Member Author

marcoscaceres commented Mar 3, 2021

Here is the link to the HTML spec:
https://html.spec.whatwg.org/multipage/links.html#link-type-manifest

Here is the markup there:

<h5 id="link-type-manifest"><span class="secno">4.6.6.10</span> Link type "<dfn><code>manifest</code></dfn>"<a href="#link-type-manifest" class="self-link"></a></h5>

@tidoust
Copy link
Member

tidoust commented Mar 3, 2021

add support for headings as definitions in Webref?

To clarify the request, are you looking for a place where headings are listed? Or is it specifically about integrating the headings into the dfns extracts?

If the former, I note Webref has them already in dedicated extracts. For instance, the heading you mention can be found in ed/headings/html.json at line 1482.

If the latter, we defined the dfns extracts as: "anything in a <dfn>", but that definition could perhaps rather be "anything that can be referenced in a spec". That seems doable.

fix the HTML spec to add ?

I would rather adapt the dfns extraction logic than start wrapping headings in <dfn> simply to have them picked up by that logic. We take for granted that headings are always exported.

By the way, I note that neither dfns nor headings extracts preserve the markup for the linking text. Ideally, [=link type "manifest"=] would get expanded to something like <a href="...">link type "<code>manifest</code>"</a>, but the <code> info does not appear in the extracts. I suppose that was the case in Shepherd as well.

@dontcallmedom
Copy link
Member

The ultimate goal should be to fix the HTML spec, which we've started doing e.g. whatwg/html#5694
But a short-term fix would involve patching Reffy - looking at the HTML definitions in webref, they already includes "link-type-manifest", but it's marked as private - I don't know if we can safely assume that all the defined terms in headings in the HTML specs are meant to be exported; if they do, it should be a very simple fix

@tidoust
Copy link
Member

tidoust commented Mar 3, 2021

I don't know if we can safely assume that all the defined terms in headings in the HTML specs are meant to be exported; if they do, it should be a very simple fix

The entry would still be for the "manifest" term in the heading, not for the heading itself, which is what I understand @marcoscaceres needs here.

@dontcallmedom
Copy link
Member

Hmm... Good point; I guess we had talked about exposing spec headings as possible end point for autolinks, but I don't think that has happened yet.

(I haven't checked if the initial intent is really to link to the section vs the defined term though)

@marcoscaceres
Copy link
Member Author

marcoscaceres commented Mar 4, 2021

@tidoust wrote

To clarify the request, are you looking for a place where headings are listed? Or is it specifically about integrating the headings into the dfns extracts?

integrating the headings into the dfns extracts

I would rather adapt the dfns extraction logic than start wrapping headings in simply to have them picked up by that logic. We take for granted that headings are always exported.

I'm a bit worried about that... we might end up with duplicate definitions.

By the way, I note that neither dfns nor headings extracts preserve the markup for the linking text. Ideally, [=link type "manifest"=] would get expanded to something like <a href="...">link type "<code>manifest</code>"</a>, but the <code> info does not appear in the extracts. I suppose that was the case in Shepherd as well.

Correct, though not a big deal. However, it might be a nice thing to have.

@dontcallmedom wrote:

I don't know if we can safely assume that all the defined terms in headings in the HTML specs are meant to be exported; if they do, it should be a very simple fix

Agree. I'd prefer we export them explicitly.

@tidoust wrote:

The entry would still be for the "manifest" term in the heading, not for the heading itself, which is what I understand @marcoscaceres needs here.

Kinda right... specifically, link type "manifest"... I don't mind just sending a PR to HTML to explicitly export it (like you are doing in whatwg/html#5694).

Should I just add <dfn export> to the <h5>link type "manifest" for now? Seems like the safest option.

@marcoscaceres
Copy link
Member Author

Hmm.. looks like best I can do is:

<h5>Link type "<dfn export data-lt="link type manifest"><code data-x="rel-manifest">manifest</code></dfn>"</h5>

I might try that and see what the HTML folks say.

@marcoscaceres
Copy link
Member Author

Sent whatwg/html#6445

@marcoscaceres
Copy link
Member Author

Closing, as attribute value exports are now done properly in HTML.

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