Skip to content

Documentation System

KoAkademy uses a documentation workflow with two source types:

  1. CONTRIBUTING.md is the only remaining root-level canonical Markdown source; it syncs to docs/src/content/docs/start-here/contributing.mdx.
  2. The other foundational guides (installation, deployment, configuration, troubleshooting, development, architecture, FAQ) and all specialized guides (System Internals, Maintainers, User Guides, Enrollment Blueprints, API Reference, OSS) are native MDX files authored directly under docs/src/content/docs/.
Canonical Root Docs (e.g. CONTRIBUTING.md)
│
├──▶ npm run docs:sync (scripts/sync-docs.mjs)
│ └── Generates MDX mirrors with frontmatter & warning headers
│
└──▶ npm run docs:check (scripts/check-docs.mjs)
├── Validates mirrors are up to date
├── Checks that internal links resolve correctly
└── Verifies API contract documentation

Mapping of Canonical Files to Generated Mirrors

Section titled “Mapping of Canonical Files to Generated Mirrors”
Canonical Root File Generated Site Mirror Sidebar Placement
CONTRIBUTING.md docs/src/content/docs/start-here/contributing.mdx Start Here → Contributing

The installation, deployment, configuration, troubleshooting, development, architecture, and FAQ pages are native MDX files edited directly under docs/src/content/docs/.

Decision Table: Where to Write New Documentation

Section titled “Decision Table: Where to Write New Documentation”
If you are writing… Edit this location Workflow
Setup, installation, or server deployment docs/src/content/docs/self-hosting/*.mdx Edit native MDX directly
Environment variables or service config docs/src/content/docs/self-hosting/configuration.mdx Edit native MDX directly
Contributor workflows, testing rules, setup CONTRIBUTING.md or docs/src/content/docs/start-here/development.mdx Edit root file or native MDX ➔ run npm run docs:sync for CONTRIBUTING
High-level runtime or architecture overview docs/src/content/docs/start-here/architecture.mdx Edit native MDX directly
Deep system internals (auth, frontend, queues) docs/src/content/docs/system/*.mdx Edit native MDX directly
Module development or maintainer processes docs/src/content/docs/maintainers/*.mdx Edit native MDX directly
User and staff operational guides docs/src/content/docs/user-guide/*.mdx Edit native MDX directly
Enrollment blueprint engine guides docs/src/content/docs/enrollment-policies/*.mdx Edit native MDX directly
Public REST API reference docs/src/content/docs/api/*.mdx Edit native MDX directly

Always run the full documentation verification before pushing:

Terminal window
# 1. Sync any canonical changes to their mirrors
npm run docs:sync
# 2. Check for stale mirrors and broken internal links
npm run docs:check
# 3. Test the Astro production build locally
npm --prefix docs run build
  • Framework: Astro 5 with @astrojs/starlight and @astrojs/mdx.
  • Search: Built-in client-side Pagefind indexing.
  • Typography & Styling: Self-hosted @fontsource/inter and @fontsource/jetbrains-mono with custom CSS matching the application’s shadcn/ui palette (docs/src/styles/custom.css).
  • Sidebar Navigation: Configured explicitly in docs/astro.config.mjs.
  • In-App Integration: The same generated documentation files are rendered inside the running application at /docs.

The documentation site is automatically built and deployed to GitHub Pages on documentation changes merged into master via .github/workflows/deploy-docs.yml.

When deploying:

  1. Ensure GitHub Pages is configured with Source: GitHub Actions in repository settings.
  2. The site publishes to https://yukazakiri.github.io/koakademy/.