Repository navigation
Mount API pages in the navigation of isolated builds - #4718
Merged
Merged
Conversation
A toc entry such as `api: elasticsearch` now mounts a floating section: a set of pages that owns its URL root and sidebar and is not made of Markdown files. A provider resolves the section before navigation is built, and it renders as an island. `CreateLinkReference()` skips these nodes instead of casting them to `MarkdownFile`. No provider is registered yet, so a build that uses the entry reports an error. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…entries The site assembler dropped every root child of a mounted docset and warned that it was undeclared, so an `api:` entry vanished from the assembled navigation. Floating section roots now carry a marker interface and the assembler keeps them. An `api:` entry that also sets `children:`, `file:` or other keys now reports an error instead of silently dropping them. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A floating section root now exists as soon as the toc mounts it, with its landing URL and title, so layout code can link to it. The children come later from `ResolveAsync`, which `DocumentationSet.ResolveFloatingSectionsAsync` runs before generation. The children keep their own numbering, so filling them never renumbers the surrounding navigation. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The narrative root copied only leaf items into the site tree, so an `- api: <key>` entry in its toc resolved and then vanished. The root now keeps floating section roots next to its leaves. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ResolveDirectoryTree now fills floating sections, so DocumentationGenerator, the assembler and the codex build see their pages without a separate call. The test goes through ResolveDirectoryTree and checks resolution runs once. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
An `api: <key>` toc entry now resolves to an API section. Its root exists when the toc is read, and `ResolveAsync` fills it with the version trees before generation. The generator builds each API's trees once and renders from them, so mounting a section adds no second fetch or build. Only the current version is visible. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The docset now fills floating sections itself, so a build run with `--skip-api` resolves an `api:` entry without a generator. The section stays empty and hidden instead of failing. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ip-api A spec that fails to build no longer stops the Markdown build: the section reports the error and hides. The section also hides when no main version resolved, and a hidden API no longer appears in the section dropdown. The generation state records --skip-api, so toggling it triggers a full build. The docs now say that only the isolated build accepts api: entries. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Comment on lines
+507
to
+510
| if (Context.SkipOpenApi != generationState.SkipOpenApi) | ||
| { | ||
| _logger.LogInformation("Full compilation: --skip-api differs from the previous build, so the API navigation links change"); | ||
| return CompilationMode.Full; |
There was a problem hiding this comment.
Severity: P3 (Low)
Add a regression test that builds into the same output twice with unchanged Markdown and toggles --skip-api in both directions. No test exercises the new persisted flag or compilation-mode check, so the cache-invalidation fix is unprotected; the provider-only tests cannot detect a broken state round-trip or missing settings propagation. Verify that unchanged pages gain or lose the API navigation link on the second build.
Generated by Libra. React with 👍 or 👎 to give feedback on this comment.
The floating section no longer emits its own error when tree building fails, because the generator awaits the same cached task and already reports it with the stack trace. The no-main test now makes main unreadable without throwing, so it proves released versions loaded. A new build-twice test covers toggling --skip-api over unchanged pages. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Nov 5, 2026
This was referenced Nov 5, 2026
Mpdreamz
enabled auto-merge (squash)
November 5, 2026 19:03
Mpdreamz
disabled auto-merge
November 5, 2026 19:12
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.
A
- api: <key>toc entry now mounts that API's pages in the navigation of an isolated build: the sidebar links the API, and every version of it is part of the navigation tree. A failed or skipped API stays out of the sidebar, and no docset uses the entry yet, so existing builds are unchanged.Affects: Navigation, API reference, Isolated builds
Prompt summary: Make API pages part of the navigation tree in isolated and assembler builds, because the sitemap,
links.jsonandllms.txtall read that tree. The API is the first floating section of the design in RFC: Floating sections in the navigation tree, with the root created up front and its details filled in later.Why
API pages are built by
OpenApiGeneratorafter the Markdown build and never join the navigation tree (docs-eng-team#825). The floating section mechanism in the first PR has no provider yet, so nothing can use it.What
The API section
ApiFloatingSectionProviderresolves anapi:toc value to a section. The section root exists when the toc is read, with its landing URL and the product name, so layout code can link to it. When the docset resolves its tree, the section fills the root with one tree per version. Only themaintree is visible, so older versions stay out of the sitemap and first-level walks.One build of the trees
OpenApiGeneratornow builds the version trees of each API once, inTreesFor, and renders from the same trees. Mounting a section adds no second fetch and no second build. The extraction changes no rendered output: the API Explorer tests pass unchanged.A failed or skipped API
A spec that fails to build no longer stops the Markdown build. The generator reports the error once, and the section hides. The section also hides when no
mainversion resolved, and a build run with--skip-apinever attaches a generator, so its sections stay empty and hidden. A hidden section is left out of the sidebar, so no link points at a page that was not built.Incremental builds
The generation state records
--skip-api, so toggling it over unchanged pages triggers a full build. The sidebar links change with the flag, and a stale incremental build would keep the old ones.Isolated build and docs
IsolatedBuildServiceregisters the provider before the docset is built and attaches the generator once it exists.docs/data/openapi/api-explorer.mddocuments theapi:toc entry and says that only isolated builds accept it.Stack: 2 of 5, on top of #4716.
Out of scope: the assembler build,
serve,navigation.ymlmounting, API pages inlinks.json, the sitemap, andllms.txt. A docset that declares APIs but has noapi:toc entry is unchanged.Verify
To see it, add
- api: elasticsearchto thetoc:ofdocs/_docset.ymland run an isolated build. The docs sidebar then links the API, and the build reports no errors.servedoes not mountapi:entries yet.🤖 Generated with Claude Code