fix(cli-reference): use segment path instead of segment/index.md for namespace page cards#3489
Merged
Merged
Conversation
Allow cli TOC entries to override the generated root page title and navigation label without changing schema command names. Co-authored-by: GPT-5.5 <gpt-5.5@openai.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve the CLI reference generator overlap by preserving supplemental frontmatter output and keeping the root title override for the generated H1. Co-authored-by: GPT-5.5 <gpt-5.5@openai.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: GPT-5.5 <gpt-5.5@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
…namespace page cards Namespace and sub-namespace page card links were generated as ./segment/index.md, which the docs-builder resolved to /cli/.../segment/index (a 404) instead of /cli/.../segment. Drop the /index.md suffix so links resolve to the correct namespace URL. Affects RootPage (top-level namespaces), NamespacePage (sub-namespaces and alias blurb links). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/Elastic.Markdown/Extensions/CliReference/CliRootFile.cs`:
- Around line 33-35: Trim the provided override strings before assigning them to
the backing fields so leading/trailing whitespace isn't preserved: when
computing _title and _navigationTitle (in the CliRootFile
constructor/initializer where _title = ... and _navigationTitle = ... are set)
call Trim() (or TrimInvariant) on the inputs (title and navigationTitle) before
checking IsNullOrWhiteSpace and before assigning to Title/_navigationTitle so
stored Title and NavigationTitle are the trimmed values.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: d869eb17-27dc-4275-b419-48e1654f8760
📒 Files selected for processing (9)
docs/cli/cli-reference-how-to.mdsrc/Elastic.Documentation.Configuration/Toc/CliReference/CliReferenceRef.cssrc/Elastic.Documentation.Configuration/Toc/DocumentationSetFile.cssrc/Elastic.Documentation.Configuration/Toc/TableOfContentsYamlConverters.cssrc/Elastic.Markdown/Extensions/CliReference/CliMarkdownGenerator.cssrc/Elastic.Markdown/Extensions/CliReference/CliReferenceDocsBuilderExtension.cssrc/Elastic.Markdown/Extensions/CliReference/CliRootFile.cstests/Elastic.Documentation.Configuration.Tests/PhysicalDocsetTests.cstests/Elastic.Markdown.Tests/CliReference/CliMarkdownGeneratorTests.cs
Prevents padded whitespace in non-empty overrides from leaking into nav/file metadata. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Mpdreamz
approved these changes
Jun 11, 2026
theletterf
added a commit
to theletterf/cli
that referenced
this pull request
Jun 11, 2026
Now that the docs-builder correctly resolves namespace page card URLs (elastic/docs-builder#3489), the supplemental content files can go back to their original subdirectory form (stack/es/index.md). The flat-file approach broke command links on the es/kb pages by displacing the schema-generated page structure. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
./segment/index.md/cli/.../segment/index(404) instead of/cli/.../segment/index.mdsuffix — use the bare segment path so the link resolves to the correct namespace URLAffected call sites in
CliMarkdownGenerator.cs:RootPage: top-level namespace cardsNamespacePage: sub-namespace cards and alias blurb linksTest plan
/cli/stackgo to/cli/stack/es, not/cli/stack/es/index🤖 Generated with Claude Code