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

Spec section: Avoid dupe titles; treat anchors as optional #3746

Merged
merged 3 commits into from
May 10, 2021

Conversation

Elchi3
Copy link
Member

@Elchi3 Elchi3 commented May 7, 2021

It was a bit naive to think that we will find anchored links for all specification urls.
There are in fact a few features that won't have it, see mdn/browser-compat-data#10353
So, the renderer should check if it is there and only then display the anchor.

The other change is duplicate titles: Sometimes the w3c/browser-specs package uses the same title and shortTitle. Displaying both looks weird. So, we shouldn't do that. Test case: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at#specifications

@peterbe
Copy link
Contributor

peterbe commented May 10, 2021

Before
Screen Shot 2021-05-10 at 10 09 38 AM

After
Screen Shot 2021-05-10 at 10 09 54 AM

For the record, I don't understand what the # stands for or means.
That anchor link, couldn't it be
"Additions to Properties of the Array Prototype Object" that is link text?

@Elchi3
Copy link
Member Author

Elchi3 commented May 10, 2021

After

hm, some fancy things happened to white space during the commit. I'll look into it.

couldn't it be "Additions to Properties of the Array Prototype Object" that is link text?

Yeah, I reckon this would be better. I just learned last week that there is another package that provides this text: https://github.com/w3c/webref/blob/master/ed/headings/tc39-relative-indexing-method.json#L8

So, I think we probably want to follow-up and also integrate the webref package. (which is a bit larger package, but it contains many useful things for us. We also figured we can probably retire mdn/data and use webref, so that would be really cool then).

Copy link
Contributor

@peterbe peterbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can merge in https://github.com/Elchi3/yari/pull/337 I can take another closer look.

@peterbe
Copy link
Contributor

peterbe commented May 10, 2021

For the record, I don't understand what the # stands for or means.
That anchor link, couldn't it be
"Additions to Properties of the Array Prototype Object" that is link text?

So the "Additions to Properties of the Array Prototype Object" stuff isn't available. OK.
But then I still wonder what # sec-array-prototype-additions really means?
I guess I still don't understand the point of this second line, from a reader's point of view.

@Elchi3
Copy link
Member Author

Elchi3 commented May 10, 2021

So the "Additions to Properties of the Array Prototype Object" stuff isn't available. OK.
But then I still wonder what # sec-array-prototype-additions really means?
I guess I still don't understand the point of this second line, from a reader's point of view.

Yup, good point. The old tables do that, too, that's why I preserved it. I guess it is there to stress the fact that it is a deep link into the specification but I'm also not sure how useful it really is. It doesn't add that much value for sure now that's just the anchor and no proper link text (yet).

@peterbe peterbe merged commit 98ad1d8 into mdn:main May 10, 2021
@Elchi3 Elchi3 deleted the spec-no-anchors branch May 10, 2021 14:52
peterbe added a commit to peterbe/yari that referenced this pull request Jun 1, 2021
* Spec section: Avoid dupe titles; treat anchors as optional

* review on mdn#3746

Co-authored-by: Peter Bengtsson <mail@peterbe.com>
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