Skip to content

fix(html): list pages without a document-level stability index - #1061

Open
zeexzeex wants to merge 1 commit into
nodejs:mainfrom
zeexzeex:fix/index-page-missing-docs
Open

fix(html): list pages without a document-level stability index#1061
zeexzeex wants to merge 1 commit into
nodejs:mainfrom
zeexzeex:fix/index-page-missing-docs

Conversation

@zeexzeex

@zeexzeex zeexzeex commented Sep 1, 2026

Copy link
Copy Markdown

Description

What

The generated index page drops every document that has no document-level stability index. Against the current nodejs/node docs 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:

return getSortedHeadNodes(input)
  .filter(entry => entry.stability)

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:

Document > Stability: occurrences in the file
cli.md 50
process.md 20
errors.md 15
module.md 7

cli carries 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 index itself, which is the page doing the listing. That exclusion follows the existing pattern in jsx-ast/generate.mjs:

const moduleInput = input.filter(
  entry => entry.api !== 'index' && !entry.chunk
);

The stability badge now renders only when the entry has an index. Without that guard parseInt(undefined, 10) gives NaN, which renders an empty badge and reads out as Stability: undefined to a screen reader.

One test helper needed a fix: makeEntry() built entries without content, which the old filter happened to screen out. content is not optional in MetadataEntry, so the helper now matches the real shape rather than the code guarding against something the pipeline cannot produce.

Validation

Built the current nodejs/node docs before and after:

node packages/cli/bin/cli.mjs generate \
  -i "<node>/doc/api/*.md" -t html -o out \
  --index "<node>/doc/api/index.md" \
  -v v26.0.0 -c https://github.com/nodejs/node/releases
Before After
Pages generated 68 68
Pages listed on the index 55 68
Missing 13 0
index itself listed no no

The output contains no Stability: undefined and no NaN. The 12 entries without an index render with no badge.

node --run test reports 571/575. The 4 failures (core/generators, react/html, section-pages x2) are present on main as 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

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run node --run test and all tests passed.
  • I have check code formatting with node --run format:check & node --run lint.
  • I've covered new added functionality with unit tests if necessary.

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>
@zeexzeex
zeexzeex requested a review from a team as a code owner September 1, 2026 00:31
@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
api-docs-tooling Ready Ready Preview Sep 1, 2026 12:33am UTC

Request Review

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.

node:module ins't present in generated index page

1 participant