tools, docs: fix stability index isssues#20731
Closed
vsemozhetbyt wants to merge 1 commit intonodejs:masterfrom
vsemozhetbyt:doc-stability-nits
Closed
tools, docs: fix stability index isssues#20731vsemozhetbyt wants to merge 1 commit intonodejs:masterfrom vsemozhetbyt:doc-stability-nits
vsemozhetbyt wants to merge 1 commit intonodejs:masterfrom
vsemozhetbyt:doc-stability-nits
Conversation
This comment has been minimized.
This comment has been minimized.
BridgeAR
approved these changes
May 15, 2018
Member
BridgeAR
left a comment
There was a problem hiding this comment.
LGTM but I suggest to use a shorter version.
tools/doc/html.js
Outdated
Member
There was a problem hiding this comment.
I suggest to change this to something like:
const link = filename === 'documentation' &&
heading && heading.text === 'Stability Index' ?
`${prefix} ${number}` :
'<a href="documentation.html#documentation_stability_index">' +
`${prefix} ${number}</a>`;
token.text = `<div class="api_stability api_stability_${number}">` +
`${link}${explication}</div>`
.replace(/\n/g, ' ');It is just a bit shorter due to having less repetition.
tools/doc/html.js
Outdated
jasnell
approved these changes
May 15, 2018
1. Do not autolink in doc stability section. 2. Do not add void wrapping elements to docs.
Contributor
Author
|
I've reduced diff and repetitions, PTAL. CI-lite: https://ci.nodejs.org/job/node-test-pull-request-lite/711/ |
BridgeAR
approved these changes
May 15, 2018
trivikr
approved these changes
May 16, 2018
vsemozhetbyt
added a commit
that referenced
this pull request
May 17, 2018
1. Do not autolink in doc stability section. 2. Do not add void wrapping elements to docs. PR-URL: #20731 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Contributor
Author
|
Landed in 2773de5 |
MylesBorins
pushed a commit
that referenced
this pull request
May 22, 2018
1. Do not autolink in doc stability section. 2. Do not add void wrapping elements to docs. PR-URL: #20731 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesChange 1: do not autolink in doc stability section
Currently, stability index descriptions in
documentation.htmlcontain links to their very section which is redundant. This commit preventstools/doc/html.jsfrom adding this links.Screenshots of "before" and "after" states:
Before:
After:
Change 2: do not add void wrapping elements to docs
Currently, all the TOC links are wrapped in
spanelements with class according to stability index of their sections. However, most doc sections have not any stability index, so these spans have useless classstability_undefined. This commit preventstools/doc/html.jsfrom wrapping TOC links in useless spans.Screenshots of "before" and "after" states (no visible difference):
Before:
After:
This PR eliminates 4402 useless elements in docs and reduces doc size by ~ 176 KB.