fix(html): list pages without a document-level stability index - #1061
Open
zeexzeex wants to merge 1 commit into
Open
fix(html): list pages without a document-level stability index#1061zeexzeex wants to merge 1 commit into
zeexzeex wants to merge 1 commit into
Conversation
The generated index page is built from every page carrying a stability index, so a document that has none is dropped from the listing. A document-level stability index is optional. Documents such as `cli`, `process` and `errors` place stability on their individual sections instead, and `cli` alone carries 50 of them, so having none at the document level says nothing about whether the page belongs in a listing of the documentation. Against the current nodejs/node docs this drops 13 of 68 pages, including `module`, the one the issue reports, along with `process`, `errors` and `cli`. The sidebar, built from the same input by `buildPageList()`, applies no such filter and lists all of them. List every page instead, excluding only the index itself, which is the page doing the listing. The stability badge renders only when the entry has an index, so a page without one no longer produces an empty badge labelled `Stability: undefined`. Fixes: nodejs#1055 Signed-off-by: Avocado <ujubongbong@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Description
What
The generated index page drops every document that has no document-level stability index. Against the current
nodejs/nodedocs that is 13 of 68 pages:module(the one this issue reports),process,errors,cli,deprecations,packages,permissions,v8,intl,addons,embedding,environment_variables,documentation.Why
buildDocumentationIndex()keeps only entries that carry a stability index:A document-level stability index is optional, and having none says nothing about whether a page belongs in a listing of the documentation. These pages place stability on their individual sections instead:
> Stability:occurrences in the filecli.mdprocess.mderrors.mdmodule.mdclicarries 50 of them and is still dropped, because none of them sit at the document level.The sidebar disagrees with the index page on this.
buildPageList(), one function above and fed the same input, applies no such filter and lists all 68.How
List every page, excluding only
indexitself, which is the page doing the listing. That exclusion follows the existing pattern injsx-ast/generate.mjs:The stability badge now renders only when the entry has an index. Without that guard
parseInt(undefined, 10)givesNaN, which renders an empty badge and reads out asStability: undefinedto a screen reader.One test helper needed a fix:
makeEntry()built entries withoutcontent, which the old filter happened to screen out.contentis not optional inMetadataEntry, so the helper now matches the real shape rather than the code guarding against something the pipeline cannot produce.Validation
Built the current
nodejs/nodedocs before and after:indexitself listedThe output contains no
Stability: undefinedand noNaN. The 12 entries without an index render with no badge.node --run testreports 571/575. The 4 failures (core/generators,react/html,section-pagesx2) are present onmainas well: 570/574 there, so this adds one test and one pass and leaves the failure count unchanged. None of them touch the files in this PR.Related Issues
Fixes #1055
Check List
node --run testand all tests passed.node --run format:check&node --run lint.