Docs Registry
Auto-generated at build time | Documentation metadata | Navigation system
Overview
The Docs Registry (.nextspark/registries/docs-registry.ts) is an auto-generated registry providing metadata and structure for all documentation pages.
Key Benefits:
- Zero runtime I/O - All docs metadata at build time
- Automatic navigation - Sections and pages auto-discovered
- Two-audience support - Public docs and Superadmin docs
- Order-based organization - Numeric prefixes control order
- Type-safe access - Full TypeScript support
Generated by: core/scripts/build/docs-registry.mjs
Location: .nextspark/registries/docs-registry.ts
Registry Structure
export interface DocsRegistryStructure {
public: DocSectionMeta[] // User-facing docs → /docs
superadmin: DocSectionMeta[] // Admin docs → /superadmin/docs
all: DocSectionMeta[] // Combined (public + superadmin)
}
DocSectionMeta Interface
export interface DocSectionMeta {
title: string // Section title
slug: string // Section identifier
order: number // Display order
pages: DocPageMeta[] // Pages in this section
source: 'public' | 'superadmin' // Documentation audience
}
DocPageMeta Interface
export interface DocPageMeta {
slug: string // Page identifier
title: string // Page title
order: number // Display order
path: string // Path to markdown file
source: 'public' | 'superadmin' // Documentation audience
}
Directory Structure
themes/{theme}/docs/
├── public/ # User-facing documentation → /docs
│ ├── 01-getting-started/
│ │ ├── 01-introduction.md
│ │ └── 02-installation.md
│ └── 02-features/
│ └── 01-overview.md
└── superadmin/ # Administrator docs → /superadmin/docs
├── 01-setup/
│ ├── 01-configuration.md
│ └── 02-deployment.md
└── 02-management/
└── 01-users.md
Note: Core framework docs (packages/core/docs/) are NOT included in the registry. They are development documentation accessed via IDE or LLM tools.
Helper Functions
import {
DOCS_REGISTRY,
getPublicDocSections,
getSuperadminDocSections,
findDocSection,
findDocPage
} from '@nextsparkjs/registries/docs-registry'
// Get public docs for /docs routes
const publicSections = getPublicDocSections()
// Get admin docs for /superadmin/docs routes
const adminSections = getSuperadminDocSections()
// Find a specific section
const section = findDocSection('getting-started')
// Find a specific page
const page = findDocPage('getting-started', 'introduction')
Performance
| Operation | Time | Approach |
|---|---|---|
| Docs metadata | ~1ms | Direct object access |
| Runtime file scan | ~140ms | File system I/O |
| Improvement | ~140x | Build-time generation |
Full Documentation
For complete documentation including:
- Build process details
- Navigation generation
- Component integration
- Troubleshooting