Skip to content

Conversation

Mpdreamz
Copy link
Member

@Mpdreamz Mpdreamz commented Oct 3, 2025

This PR is a draft, it represents a completely new isolated flow for building our navigation using the existing navigation interfaces.

Main effort is ensuring reading the configuration yaml files and building the navigation are isolated by to separate classes.

Isolated Builds:

  • Separate DocumentationSetFile (docset.yml) deserialization.
  • Separate TableOfContentsFile (toc.yml) deserialization.
  • DocumentationSetNavigation uses DocumentationSetFile to build navigation.
  • DocumentationSetNavigation uses reads through toc references and includes the resulting TableOfContentsNavigation in the parent DocumentationSetNavigation or TableOfContentsNavigation

Assembler Builds:

  • Separate SiteNavigationFile deserialization.
  • SiteNavigation uses SiteNavigationFile and a list of DocumentationSetNavigation
  • SiteNavigation picks DocumentationSetNavigation or its nested TableOfContentsNavigation as defined in navigation.yml to build the large site navigation.
  • Setting PathPrefix on TableOfContentsNavigation and DocumentationSetNavigation instances is viral, all nested nodes will reflect the change. (This makes rehoming these nodes under a new path_prefix a lot cleaner)
  • The navigation is in full control of URL building.

All of these exist in Elastic.Documentation.Configuration and a new isolated Elastic.Documentation.Navigation. The new navigation components have extensive tests in new test projects.

Still Todo:

  • The new navigation does not inject DocumentationFile as its .Model yet.
  • Remove all viral properties on MarkdownFile.
  • Replace/remove current navigation items (TableOfContentsTree, DocumentationGroup etc).
  • Ensure the navigation clicks correctly into HtmlWriter and other related navigation components. Most if not all use the navigation interfaces already.
  • Implement updating NavigationIndex and .Parent in the new navigation.
  • Implement more error/warning diagnostics. Especially around URL uniqueness. Conflicting path_prefixes.

@Mpdreamz Mpdreamz self-assigned this Oct 3, 2025
@Mpdreamz Mpdreamz changed the title refactor/navigation [Draft] Build navigation from scratch Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant