Overview
Comprehensive documentation system guides
Documentation System Guide
📖 Comprehensive guide for AI agents on how to find, write, organize, and maintain documentation in our docs-angular system.
🎯 Quick Reference
Essential Commands
# Check active documentation root
cat apps/docs-angular/docs-config.ts
# Scan for new documentation files
yarn docs:scan
# Watch for file changes (auto-scan)
yarn docs:dev # Starts dev server with watch mode
# Serve documentation locally
npx nx serve docs-angular # Runs on port 5010
Key Files to Know
- Config:
apps/docs-angular/docs-config.ts- Active documentation root path - Manifest:
apps/docs-angular/src/assets/docs-manifest.json- Auto-generated file structure - Folders Config:
apps/docs-angular/src/assets/docs-folders-config.json- Project settings - Admin Panel:
/adminin docs-angular - Management tools
📚 What is docs-angular?
docs-angular is our modern Angular 20-based documentation system that:
- Automatically discovers documentation files from the file system
- Generates navigation dynamically without manual route configuration
- Supports multi-language (English/Spanish) with intelligent switching
- Provides powerful search across all projects (⌘K / Ctrl+K)
- Manages project-scoped documentation with isolation
- Renders markdown with enhanced features (MDC support, code highlighting, etc.)
Current Active Documentation Root: docs/ (workspace root)
Fallback Location: apps/docs-angular/src/assets/docs/
🔍 How to FIND Documentation
Step 1: Determine Documentation Root
ALWAYS check the active root first:
// Read: apps/docs-angular/docs-config.ts
export const DOCS_CONFIG = {
docsPath: 'docs', // ← This is the active root
fallbackPaths: ["apps/docs-angular/src/assets/docs"]
}
Current Status (as of 2025): docsPath: 'docs' is active
Step 2: Understand File Structure
Documentation follows this structure:
<DOCS_ROOT>/ # Currently: docs/
├── english/ # English documentation
│ ├── public/ # Global public docs (routes start with /)
│ │ ├── documentation/ # System documentation
│ │ ├── development/ # Development guides
│ │ ├── features/ # Feature documentation
│ │ ├── troubleshooting/ # Troubleshooting guides
│ │ └── miscellaneous/ # Miscellaneous docs
│ └── <ProjectName>/ # Project-scoped docs (routes: /ProjectName/...)
│ ├── index.md # Project landing page
│ └── <section>/ # Project sections
├── spanish/ # Spanish documentation
│ ├── public/ # Spanish public docs (routes: /es/...)
│ └── <ProjectName>/ # Spanish project docs
└── (manifests and configs) # Auto-generated files
Step 3: Locate Specific Documentation
For Public Documentation:
- Path:
docs/english/public/<section>/<file>.md - URL:
/<section>/<file>(no/public/in URL)
For Project Documentation:
- Path:
docs/english/<ProjectName>/<section>/<file>.md - URL:
/<ProjectName>/<section>/<file>
Examples:
File: docs/english/public/development/angular/index.md
URL: /development/angular
File: docs/english/GoGrab-Space/platform/index.md
URL: /GoGrab-Space/platform
File: docs/spanish/public/documentacion/guia.md
URL: /es/documentacion/guia
Step 4: Use the Manifest
The manifest (docs-manifest.json) contains the complete file structure:
{
"structure": [
{
"name": "documentation",
"type": "directory",
"path": "english/public/documentation",
"items": [...]
}
]
}
Step 5: Search Functionality
In docs-angular app:
- Press
⌘K(Mac) orCtrl+K(Windows/Linux) - Search is project-scoped by default (respects current project)
- Results show project badges and color coding
- Can filter by project tags
Configuration:
- Search behavior controlled by
docs-folders-config.json - Settings:
scopeToCurrentProject,crossProjectSearch, etc.
✍️ How to WRITE Documentation
Step 1: Choose the Right Location
Decision Tree:
Is this project-specific?
- ✅ Yes →
docs/english/<ProjectName>/<section>/file.md - ❌ No → Continue to step 2
- ✅ Yes →
Is this for general development/documentation?
- ✅ Yes →
docs/english/public/documentation/ordevelopment/ - ❌ No → Continue to step 3
- ✅ Yes →
Is this a feature guide?
- ✅ Yes →
docs/english/public/features/ - ❌ No → Continue to step 4
- ✅ Yes →
Is this troubleshooting?
- ✅ Yes →
docs/english/public/troubleshooting/ - ❌ No → Use
docs/english/public/miscellaneous/
- ✅ Yes →
Default Locations:
- Don't know where to place? →
docs/english/public/miscellaneous/ - Development guides? →
docs/english/public/development/ - Troubleshooting? →
docs/english/public/troubleshooting/
Step 2: Create the File
File Naming:
- ✅ Use kebab-case:
my-awesome-guide.md - ✅ Be descriptive:
setup-guide.mdnotguide.md - ❌ Avoid spaces:
My Awesome Guide.md
File Structure:
# Single file
docs/english/public/my-section/my-guide.md
# Organized section
docs/english/public/my-section/
├── index.md # Landing page for section
├── overview.md # Overview
├── getting-started.md # Getting started
└── advanced.md # Advanced topics
For Spanish:
# Same structure, different language folder
docs/spanish/public/mi-seccion/mi-guia.md
Step 3: Add Frontmatter
Minimal Frontmatter (Recommended):
---
title: Widget Builder Overview
description: Introduction to building widgets
icon: 🧩
order: 1
---
Advanced Frontmatter:
---
title: Component Factory Reference
description: Complete API reference for the ComponentFactory
icon: 🔧
order: 3
tags: [angular, components, api]
author: Platform Team
lastUpdated: 2025-01-15
status: published
difficulty: intermediate
estimatedReadTime: 8
toc: true
searchable: true
layout: guide
crossLanguageId: component-factory-reference
languageVersions:
en: documentation/component-factory-reference
es: documentacion/referencia-factory-componente
---
Required Fields:
title- Page titledescription- Short description for search/navigation
Common Fields:
icon- Emoji or icon for navigationorder- Display order (lower = higher)layout- Page layout style (guide, reference, etc.)
Cross-Language Linking:
crossLanguageId: unique-page-id
languageVersions:
en: section/page-name # WITHOUT /es prefix
es: seccion/nombre-pagina
Step 4: Write Content
Markdown Structure:
# Main Title
## Section One
Content for section one...
## Section Two
Content for section two...
### Subsection
Subsection content...
Important:
- ✅ Keep headers simple and clean for reliable anchor links
- ✅ Use
## Widget Economynot## 🧩 **WIDGET ECONOMY** - ✅ Headers automatically become anchors:
## My Section→#my-section
Code Blocks:
```typescript
// Use language tags for syntax highlighting
const example = "code";
\```
Step 5: Add Links Correctly
✅ DO - Absolute Paths (Recommended):
[Documentation Guide](/documentation/add-documentation)
[Theme System](/GoGrab-Space/theme-system)
[Getting Started](/getting-started)
✅ DO - Relative Paths (Now Supported):
[Parent Section](../parent-section)
[Sibling Page](./sibling-page)
❌ DON'T:
[Guide](./guide.md) # No file extensions
[Guide](/documentation/guide.md) # No .md extension
[Guide](/public/documentation/guide) # Don't include /public/
[Guide](/english/documentation/guide) # Don't include /english/
Anchor Links:
[Jump to Section](#section-name)
[Configuration](#configuration-details)
External Links:
[Angular Docs](https://angular.dev) # Automatically opens in new tab
Internal Links in New Tab:
[Guide](/documentation/guide "new tab") # Add "new tab" to title
Step 6: Folder Metadata (Optional)
Create _folder.md to control section appearance:
---
title: Widgets
icon: 🧩
order: 10
collapsed: false
---
Optional description for the folder landing.
Step 7: Refresh Navigation
After adding files:
- Auto-watch mode: If
yarn docs:devis running, files are auto-discovered - Manual scan: Run
yarn docs:scanto update manifest - Admin panel: Use
/admin→ "Run Scan" to trigger immediately
🏗️ Project-Scoped Architecture
Understanding Project Context
The docs-angular system uses project-scoped architecture:
Features:
- Users must select a project before accessing content
- Each project acts as its own application root
- Projects can be password-protected
- Multi-tenant isolation with separate configurations
Project Types:
- Root Projects (
isRoot: true) - Standalone documentation sites - Public Documentation - Global shared documentation
Project Configuration:
{
"name": "GoGrab-Pulse",
"path": "docs/english/GoGrab-Pulse",
"language": "english",
"isRoot": true,
"password": "123456", // Optional password protection
"config": {
"search": { ... },
"navigation": { ... },
"ui": { ... }
}
}
URL Structure
Public Docs:
- English:
/section/page(no prefix) - Spanish:
/es/section/page(/esprefix)
Project Docs:
- English:
/ProjectName/section/page - Spanish:
/es/ProjectName/section/page
No Language Prefix in Frontmatter:
languageVersions:
en: section/page-name # System adds /es automatically
es: seccion/nombre-pagina
🔧 Configuration System
Documentation Root Configuration
File: apps/docs-angular/docs-config.ts
export const DOCS_CONFIG = {
docsPath: 'docs', // Active documentation root
autoDiscovery: false, // Manual discovery mode
docsDirectoryName: 'docs',
recursiveSearch: true,
maxSearchDepth: 3,
fallbackPaths: [
"apps/docs-angular/src/assets/docs"
]
}
⚠️ ALWAYS CHECK THIS FIRST before creating documentation files!
Project Configuration
File: apps/docs-angular/src/assets/docs-folders-config.json
Global Settings:
{
"globalConfig": {
"search": {
"scopeToCurrentProject": true,
"crossProjectSearch": false,
"includePrivateInGlobalSearch": false,
"maxResultsPerProject": 10
},
"navigation": { ... },
"ui": { ... }
},
"folders": [
{
"name": "GoGrab-Pulse",
"isRoot": true,
"config": { ... } // Project-specific overrides
}
]
}
Configuration Hierarchy:
- Project Config (highest priority)
- Global Config (fallback)
- Built-in Defaults (last resort)
🔍 Search System
How Search Works
- Indexing - Builds search database from manifest
- Filtering - Filters results based on project scope
- Display - Shows results with project badges
Search Configuration
Behavior Matrix:
scopeToCurrentProject |
crossProjectSearch |
Result |
|---|---|---|
true |
true |
Index all, show all |
true |
false |
Index current, show current |
false |
true |
Index all, show all |
false |
false |
Index all, filter to current |
Project-Scoped Search:
- Search is automatically scoped to current project
- Results show project badges and colors
- Can toggle global search if configured
📋 Best Practices for AI Agents
Before Writing Documentation
- ✅ Check active docs root - Read
apps/docs-angular/docs-config.ts - ✅ Find existing docs - Search for similar content first
- ✅ Choose correct location - Use decision tree above
- ✅ Check project context - Is this project-specific or public?
While Writing Documentation
- ✅ Use proper frontmatter - Include title, description, icon, order
- ✅ Keep headers simple - No complex formatting for anchors
- ✅ Use absolute paths -
/section/pageformat - ✅ No file extensions - Don't include
.mdin links - ✅ Test navigation - Verify links work before finishing
After Writing Documentation
- ✅ Trigger scan - Run
yarn docs:scanor use admin panel - ✅ Verify in sidebar - Check navigation appears correctly
- ✅ Test routes - Visit the page URL to verify rendering
- ✅ Check search - Verify page appears in search results
- ✅ Add Spanish placeholder - Create
.es.mdversion if needed
File Organization Rules
Miscellaneous Docs:
- Don't know where to place? →
docs/english/public/miscellaneous/ - Add to index:
docs/english/public/miscellaneous/miscellaneous.index.md
Development Guides:
- General development →
docs/english/public/development/ - Add to index:
docs/english/public/development/index.md
Troubleshooting:
- Debugging guides →
docs/english/public/troubleshooting/ - Add to index:
docs/english/public/troubleshooting/index.md
Common Mistakes to Avoid
❌ Using wrong documentation root
- Always check
docs-config.tsfirst
❌ Including /public/ in URLs
- URLs are
/section/page, files are inpublic/section/page.md
❌ File extensions in links
- Use
/section/pagenot/section/page.md
❌ Complex header formatting
- Use
## Simple Headernot## 🧩 **COMPLEX HEADER**
❌ Hardcoding language prefixes
- System handles
/esautomatically, don't include in frontmatter paths
🛠️ Admin Panel Features
Access: /admin in docs-angular
Features:
- Configuration Editor - Edit global/project settings
- Analytics Dashboard - View page views, searches, performance
- Docs Scanner - Start/stop watch, trigger scans
- Quick Links - Access common destinations
Default Password: admin123 (change in production!)
📚 Additional Resources
Key Documentation Files
- Add Documentation Guide - Complete step-by-step guide
- Link Guidelines - Detailed link formatting rules
- Configuration Guide - System configuration details
- Enhanced Docs System - Architecture overview
- Project-Scoped Architecture - Project isolation details
System Documentation Location
All docs-angular system documentation is stored in:
docs/english/docs-angular-docs/
├── index.md # System overview
├── add-docs/ # Adding documentation guides
├── config/ # Configuration guides
├── features/ # Feature documentation
├── technical-info/ # Technical architecture
├── progress-notes/ # Implementation history
└── troubleshooting/ # Troubleshooting guides
✅ Verification Checklist
After creating documentation, verify:
- File is in correct location (checked
docs-config.ts) - Frontmatter includes title and description
- File uses kebab-case naming
- Headers are simple and clean
- Links use absolute paths without extensions
- Manifest updated (run
yarn docs:scanor wait for watch) - Page appears in sidebar navigation
- Page URL loads correctly
- Page appears in search results
- Spanish placeholder created if needed
🚀 Quick Start Template
Creating a new documentation page:
- Choose location (e.g.,
docs/english/public/my-section/) - Create file (e.g.,
my-guide.md) - Add frontmatter:
---
title: My Guide Title
description: Short description for search
icon: 📚
order: 1
---
- Write content with simple headers
- Add links using absolute paths
- Trigger scan via admin panel or
yarn docs:scan - Verify in docs-angular app
📞 Need Help?
- Check documentation: Review guides in
/documentation/ - Use admin panel:
/adminfor management tools - Read system docs:
docs/english/docs-angular-docs/ - Console logs: Check browser console for debugging info
Last Updated: January 2025
Active Docs Root: docs/ (configured in `apps/docs-angular/docs-config.ts)
System Version: Enhanced Documentation System with Project-Scoped Architecture