Understanding the KubeStellar Documentation Architecture

Overview

This documentation website is a separate repository from the main KubeStellar codebase. All the active documentation is now located in this repository. For safety reasons, copies of the docs source may remain in a to-be-deleted folder in the component repositories during a transition period

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Main KubeStellar Repository                                โ”‚
โ”‚  github.com/kubestellar/kubestellar                         โ”‚
โ”‚  kubestellar/                                               โ”‚
โ”‚   โ”œ docs/   <-- NOT THE ACTIVE DOCS                         |
|     โ”œโ”€โ”€README.md                                            |
|     โ””โ”€โ”€content/to-be-deleted                                โ”‚
โ”‚           โ”œโ”€โ”€ readme.md                                     โ”‚
โ”‚           โ”œโ”€โ”€ architecture.md                               โ”‚
โ”‚           โ”œโ”€โ”€ direct/                                       โ”‚
โ”‚           โ”œโ”€โ”€ binding.md                                    โ”‚
โ”‚           โ”œโ”€โ”€ wds.md                                        โ”‚
โ”‚           โ””โ”€โ”€ ... (all previous documentation content)      โ”‚
โ”‚    โ””โ”€โ”€ ...(all the active components of the component repo) |
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                         
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€|
โ”‚  Docs Website Repository (THIS REPO)                           โ”‚
โ”‚  github.com/kubestellar/docs                                   |
|                                                                โ”‚  
โ”‚  docs/ <-- this repository root folder                         โ”‚
|   โ”œ docs/ <-- raw MD content source moved from repos           |
|   |   content/                                                 |
|   |     a2a/                                                   |
|   |     common-subs/                                           |
|   |     Community/                                             |
|   |     console/                                               |
|   |     contribution-guidelines/                               |
|   |     icons/                                                 |
|   |     images/                                                |
|   |     klaude/                                                |
|   |     kubeflex/                                              |
|   |     kubestellar/                                           |
|   |     kubestellar-mcp/                                       |
|   |     multi-plugin/                                          |
|   |     ui-docs/                                               |
|   |   images/ <-- image folder for some of the MD files        |
|   |  overrides/ <-- master mkdocs layouts (legacy ref)    |
|   โ”œ messages      <-- alternate language files for pages       | 
|   โ”œ src/  <-- Source for pages, site nav and layout            |    
|   | โ”œ app/                                                     |
|   | |  โ”œ docs/  <-- layouts to apply to component docs pages   |
|   | |  โ”œโ”€โ”€ page-map.ts     <-- Defines navigation structure    โ”‚
โ”‚   | |  โ”œโ”€โ”€ layout.tsx      <-- Nextra theme integration        โ”‚
|   | |  โ””โ”€โ”€ page.mdx      <-- Nextra page master                โ”‚
|   | โ”œ components/                                              โ”‚
|   | โ”œ config/                                                  โ”‚
|   | โ”œ hooks/                                                   โ”‚
|   | โ”œ i18n/ <-- configures language support                    |
|   | โ”œ lib/                                                     โ”‚
|   โ”œ CONTRIBUTING.md                                            |
|   โ”œ GOVERNANCE.md                                              |
|   โ”œ next.config.ts      <-- Nextra configuration               โ”‚
|   โ”œ mdx-components.js   <-- MDX component mappings             |
|   โ””โ”€โ”€ ... (various node.js and next.js etc files)              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          |
                    (Built & Deployed)
                          |
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Live Documentation Website                                  โ”‚
โ”‚  https://kubestellar.io                                      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Important Concepts:

  • Content lives in the docs/content folder of this kubestellar/docs repo (docs/content/)
  • The website structure is defined in the src folder of this repo
  • This repo also contains the website framework (Next.js + Nextra)
  • Navigation is defined in page-map.ts (not auto-generated from files)

How Nextra Integration Works

This documentation site is built using Nextra, a powerful Next.js-based documentation framework that provides:

  • Static Site Generation (SSG) for fast loading
  • MDX Support for rich, interactive documentation
  • Built-in Search functionality
  • Theme Customization with dark/light modes
  • Automatic Navigation generation

Key Files and Their Roles

  1. next.config.ts - Main configuration file that:

    • Imports and configures Nextra with nextra() function
    • Enables LaTeX support for mathematical expressions
    • Configures search settings
    • Integrates with next-intl for internationalization
    • Sets up redirects for various KubeStellar links
  2. src/app/docs/layout.tsx - Docs layout component that:

    • Imports Layout from nextra-theme-docs
    • Imports the Nextra theme styles
    • Configures custom navbar, footer, and banner components
    • Sets up the sidebar with page map and repository links
    • Enables dark mode and collapsible sidebar sections
  3. src/app/docs/page-map.ts - Navigation structure builder that:

    • Defines the documentation navigation structure in NAV_STRUCTURE
    • Reads documentation files from the local /docs/content/ directory
    • Constructs hierarchical navigation from the defined structure
    • Generates routes for each documentation page
    • Creates a mapping between file paths and URL routes
    • Note: The file tree structure in /docs/content roughly parallels the navigation created in pagemap.ts but is not identical. As the new site matures many of the differences will be smoothed out
    • Using the page-map rather than file structure to generate the NAV_STRUCTURE simplifies changing menus for different locales (languages)
  4. src/app/docs/[...slug]/page.tsx - Dynamic page renderer that:

    • Reads MDX content from the local /docs/content/ directory
    • Compiles and evaluates MDX with custom components
    • Processes Jekyll-style includes and template variables
    • Supports Mermaid diagrams and custom components
    • Handles image path resolution and markdown transformations
  5. mdx-components.js - Component mapping file that:

    • Exports MDX components from Nextra theme
    • Allows customization of how markdown elements render
    • Enables adding custom React components to MDX files

This page is an excerpt of the Detailed Contribution Guide. The complete file is viewable there or at github.com/kubestellar/docs/CONTRIBUTING.md. Changes to this page content should be made in CONTRIBUTING.md on GitHub.