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

Remove id attributes from JS documentation #3647

Merged
merged 1 commit into from
Mar 30, 2021

Conversation

wbamberg
Copy link
Collaborator

@wbamberg wbamberg commented Mar 29, 2021

This is based on #3607, "[Markdown] id attributes in the JavaScript documentation", and removes all id attributes from our JS documentation, except those attached to <h1>...<h6> elements.

Or at least I think it does.

What I did:

  • grepped files/en-us/web/javascript for id="
  • excluded those attached to <h1>...<h6>, and those that just appeared in sample code

This gave me:

./files/en-us/web/javascript//guide/grammar_and_types/index.html: <li id="parseInt()_and_parseFloat()">{{jsxref("parseInt", "parseInt()")}}</li>
./files/en-us/web/javascript//guide/regular_expressions/index.html:<p id="g-different-behaviors">The behavior associated with the <code>g</code> flag is different when the <code>.exec()</code> method is used.  The roles of "class" and "argument" get reversed: In the case of <code>.match()</code>, the string class (or data type) owns the method and the regular expression is just an argument, while in the case of <code>.exec()</code>, it is the regular expression that owns the method, with the string being the argument.  Contrast this <em><code>str.match(re)</code></em> versus <em><code>re.exec(str)</code></em>.  The <code>g</code> flag is used with the <strong><code>.exec()</code></strong> method to get iterative progression.</p>
./files/en-us/web/javascript//guide/details_of_the_object_model/index.html:<p><img alt="" class="internal" id="figure8.5" src="figure8.5.png"><br>
./files/en-us/web/javascript//inheritance_and_the_prototype_chain/index.html:<div class="notecard warning" id="Bad_practice_Extension_of_native_prototypes">
./files/en-us/web/javascript//inheritance_and_the_prototype_chain/index.html:<pre id="example-4" class="brush: js">
./files/en-us/web/javascript//reference/operators/in/index.html:      id="result_box" lang="en">contains</span> the property with specified name
./files/en-us/web/javascript//reference/operators/inequality/index.html:<div id="gtx-trans" style="position: absolute; left: 16px; top: 1743.2px;">
./files/en-us/web/javascript//reference/statements/let/index.html:<p id="Scoping_rules">At the top level of programs and functions,
./files/en-us/web/javascript//reference/global_objects/regexp/exec/index.html:      <td><code id="indices">indices</code></td>
./files/en-us/web/javascript//reference/global_objects/atomics/index.html:<div id="gtx-trans" style="position: absolute; left: 25px; top: 2197px;">
./files/en-us/web/javascript//reference/global_objects/string/split/index.html:<div id="split_empty_string">
./files/en-us/web/javascript//reference/strict_mode/index.html:      id="sloppyModeId333">sloppy mode</a>"</strong>. This isn't an official term, but be

(this omits some items from the list in #3607 - on closer inspection, several of those are actually attached to headings, and one has since been removed by another PR.)

I grepped the entire files/en-us tree for references to each id attribute:

  • Where there were no references I just removed the id attribute.
  • Where there was a reference I replaced it with a reference to a heading ID. The only place I wasn't able to do that was in the Firefox 88 release notes, which wants to refer to #indices, and it would be hard to reorganize that page so indices gets a heading. But I think it's OK to just link to the page here.

@wbamberg wbamberg requested review from a team as code owners March 29, 2021 21:26
@wbamberg wbamberg requested review from chrisdavidmills and removed request for a team March 29, 2021 21:26
Copy link
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

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

This looks good to me, thanks @wbamberg !

@chrisdavidmills chrisdavidmills merged commit cf95435 into mdn:main Mar 30, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 19, 2022
@wbamberg wbamberg deleted the remove-js-id-attributes branch October 15, 2022 17:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants