Monitext Documentation Specification for AI Agents
This document defines the structure and conventions for managing documentation in the Monitext monorepo.
Structure
Documentation is managed using VitePress and is located in the docs/ directory.
Package Documentation
Package documentation is stored in: docs/packages/<package-name>/src/<version>/
<package-name>: The name of the package (e.g.,nstack,nbus).<version>: The version of the documentation (e.g.,v0.0.1).index.md: The main landing page for that version.
Automatic Versioning
The VitePress configuration dynamically discovers packages and versions.
- The highest version found in
docs/packages/<pkg>/src/is automatically alias as/latest/. - Sidebars are generated based on the files present in the version directory.
Contribution Guidelines
Adding a New Package
- Create a directory:
docs/packages/<your-package>/src/v0.0.0/. - Add an
index.mdfile. - The package will automatically appear in the "Packages" navigation dropdown.
Adding a New Version
- Copy the current version directory:
cp -r docs/packages/<pkg>/src/v<old> docs/packages/<pkg>/src/v<new>. - Update the content as needed.
Editing Documentation
- Documentation uses standard Markdown.
- Sidebars are dynamic, so adding a new
.mdfile to a version directory will automatically add it to the "Guides" section of the sidebar for that version.
Syncing READMEs and CHANGELOGs
The packages/*/README.md and packages/*/CHANGELOG.md files are used as documentation entry points. The docs/scripts/sync-latest.js script handles this automatically:
README.mdis synced toindex.md(Quick Start).CHANGELOG.mdis synced tochangelog.md(Changelog).
These files are automatically detected and added to the "Getting Started" section of the sidebar.
Dynamic Features
- The
rewritesconfiguration mapspackages/:pkg/src/:ver/:slug*to/:pkg/:ver/:slug*. - Accessing
/:pkg/latest/will always resolve to the highest found version.