Fix navigation: level-based chunking, nested toc.yml, discrete sections, navigation_title - #3833
Merged
Mpdreamz merged 1 commit intoAug 14, 2026
Conversation
theletterf
approved these changes
Aug 11, 2026
Mpdreamz
force-pushed
the
feature/md-conversion-navigation
branch
from
August 14, 2026 09:52
446fe88 to
e8f2138
Compare
…ectionsByLevel, HeadingLevelBase - PageChunker: tree-shaped PageOutput with child pages, slug dedup, IsDiscrete support, AutoId replacing Slugify.Core - AsciidocParser: IsDiscrete flag for [discrete]/[float] sections; NestSectionsByLevel post-processes flat include results - MarkdownEmitter: HeadingLevelBase rebases heading levels per page root; LF-only newlines - YamlWriter: Island and Children on TocEntry; nested toc entries with island: true - ConvertCommand: Island=true per version toc entry; WritePages recursion into child pages; navigation_title frontmatter; island: true per book in docset.yml - FeatureFlags: GuideNavEnabled property - Paths/GitResolveFileSystem: DEBUG escape hatch for .slnx root; .artifacts in allowed hidden folders - docs-migrate ServeCommand: use Paths.WorkingDirectoryRoot instead of CWD - docs-migrate.csproj: add Elastic.Documentation.Tooling project reference - docs-builder ServeCommand: remove unused System.IO.Abstractions using - ChunkerTests: 391-line test suite for new chunker behaviour Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Mpdreamz
force-pushed
the
feature/md-conversion-navigation
branch
from
August 14, 2026 09:55
e8f2138 to
fb92799
Compare
yetanothertw
pushed a commit
that referenced
this pull request
Aug 14, 2026
…ectionsByLevel, HeadingLevelBase (#3833) - PageChunker: tree-shaped PageOutput with child pages, slug dedup, IsDiscrete support, AutoId replacing Slugify.Core - AsciidocParser: IsDiscrete flag for [discrete]/[float] sections; NestSectionsByLevel post-processes flat include results - MarkdownEmitter: HeadingLevelBase rebases heading levels per page root; LF-only newlines - YamlWriter: Island and Children on TocEntry; nested toc entries with island: true - ConvertCommand: Island=true per version toc entry; WritePages recursion into child pages; navigation_title frontmatter; island: true per book in docset.yml - FeatureFlags: GuideNavEnabled property - Paths/GitResolveFileSystem: DEBUG escape hatch for .slnx root; .artifacts in allowed hidden folders - docs-migrate ServeCommand: use Paths.WorkingDirectoryRoot instead of CWD - docs-migrate.csproj: add Elastic.Documentation.Tooling project reference - docs-builder ServeCommand: remove unused System.IO.Abstractions using - ChunkerTests: 391-line test suite for new chunker behaviour 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
Stacked on #3802. Fixes the converted navigation so it matches the live
elastic.co/guidesidebar exactly.Root causes:
IsIncludeRoot-only rule), producing ~2065 flat pages with 27 slug collisions instead of the correct ~2085 hierarchically nested pages.TocEntryhad noChildrenandWriteTocYamlwas non-recursive, so parent/child structure was never written totoc.yml.migration_intro.asciidoc+ individualmigrate_8_N.asciidocfiles) were assembled flat inProcessInclude, losing AsciiDoc's natural level-based nesting.Fixes:
PageChunker.csTraversepass producing a tree ofPageOutput.IsPage = !IsDiscrete && (Level==0 ? IsIncludeRoot : Level <= chunkLevel+1). Book root detection (single L0 child →index.md). Duplicate slugs get_2/_3suffixes.SectionNode.csIsDiscrete(from[discrete]/[float]block attribute).AsciidocParser.cspendingBlockAttrintoParseSectionforIsDiscrete. AddedNestSectionsByLevel()at the end ofProcessInclude— sections at level N following a section at level < N in the flat result list are re-nested as children, replicating AsciiDoc's hierarchical nesting (fixes the Migration guide pattern).MarkdownEmitter.csHeadingLevelBase+UpdateHeadingBaseso child headings rebase relative to the page root.YamlWriter.csTocEntrygainsChildren;WriteTocYamlis now recursive.ConvertCommand.csWritePagesrecursespage.Children; emitsnavigation_titlefrontmatter.ChunkerTests.csnavigation_titlefrontmatter, cross-include level nesting, and nestedtoc.ymloutput.Results for ES 8.19 (chunk:1):
toc.yml(was 2065 flat with 27 collisions)breaking-changes.md(= Migration guide) hasmigrating-8.0–migrating-8.19as childrengetting-started.mdhasnavigation_title: "Basics: Index and search using APIs"quickstart.mdhas## Requirementsinline (discrete sections stay on-page)targz.mdcontains## Next stepsinline (Level 3 rebased under Level 2 page)Test plan
dotnet test tests/Elastic.LegacyDocs.Migration.Tests/— 44 tests pass./build.sh unit-test— 314 tests passdotnet run --project src/tooling/docs-migrate -- convert --majors 1 --minors 1 --book en/elasticsearch/referencegrep -o 'file: .*' toc.yml | sort | uniq -d→ empty (no duplicate entries)https://www.elastic.co/guide/en/elasticsearch/reference/8.19/index.html🤖 Generated with Claude Code