Documentation System
Documentation System
Section titled “Documentation System”KoAkademy uses a documentation workflow with two source types:
CONTRIBUTING.mdis the only remaining root-level canonical Markdown source; it syncs todocs/src/content/docs/start-here/contributing.mdx.- 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/.
Architecture & Sync Pipeline
Section titled “Architecture & Sync Pipeline”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 documentationMapping 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 |
Running Local Verification
Section titled “Running Local Verification”Always run the full documentation verification before pushing:
# 1. Sync any canonical changes to their mirrorsnpm run docs:sync
# 2. Check for stale mirrors and broken internal linksnpm run docs:check
# 3. Test the Astro production build locallynpm --prefix docs run buildDocumentation Website Stack
Section titled “Documentation Website Stack”- Framework: Astro 5 with
@astrojs/starlightand@astrojs/mdx. - Search: Built-in client-side Pagefind indexing.
- Typography & Styling: Self-hosted
@fontsource/interand@fontsource/jetbrains-monowith 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.
Automated Deployment (GitHub Pages)
Section titled “Automated Deployment (GitHub Pages)”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:
- Ensure GitHub Pages is configured with Source: GitHub Actions in repository settings.
- The site publishes to
https://yukazakiri.github.io/koakademy/.
