Add Documentation Guide
How to add new markdown files with correct frontmatter, structure, and admin tools
Add Documentation Guide
π Complete Step-by-Step Guide
This guide explains how to add new documentation to the docs-angular application. The system now uses automatic discovery and hybrid navigation for optimal developer experience.
π For comprehensive system documentation, see Docs Angular System for detailed implementation guides.
π― Quick Overview
Adding documentation involves 2 main steps (navigation and routes are automatic):
- Create markdown files in the correct language AND project scope with proper frontmatter
- (Optional) Add folder metadata with
_folder.mdto control section icon/order/collapsed
βοΈ Documentation Root Configuration
The docs-angular system now supports configurable documentation root paths via apps/docs-angular/docs-config.ts.
Current Configuration
Check apps/docs-angular/docs-config.ts to see where documentation files should be placed:
export const DOCS_CONFIG = {
docsPath: 'docs', // Root documentation folder (ACTIVE)
autoDiscovery: false, // Manual discovery mode
docsDirectoryName: 'docs', // Directory name to search for
recursiveSearch: true, // Search recursively
maxSearchDepth: 3, // Maximum depth to search
fallbackPaths: [
"apps/docs-angular/src/assets/docs" // Fallback location
]
}
β CURRENT STATUS: The system is actively using
docs/as the primary documentation root (as of January 2025).
Supported Documentation Locations
Based on the configuration above, documentation can be placed in:
Primary Location:
docs/(workspace root)- Current configured path via
docsPath: 'docs' - Recommended for centralized documentation
- Current configured path via
Fallback Location:
apps/docs-angular/src/assets/docs/- Legacy location for backward compatibility
- Used when files are not found in primary location
π‘ TIP: Always check
docs-config.tsto confirm the active documentation root before adding files.
π Step 1: File Organization
Directory Structure (Language-first, Multi-project aware)
Documentation follows the same structure regardless of root location:
<DOCS_ROOT>/ # Either docs/ or apps/docs-angular/src/assets/docs/
βββ english/
β βββ public/ # Global public docs
β βββ documentation/
β β βββ add-documentation.md # Your new guide (this file)
β β βββ docs-angular-system/
β β βββ index.md # Section landing page (optional)
β β βββ _folder.md # Folder-level frontmatter (optional)
β β βββ <your-section>/
β β βββ overview.md
β β βββ getting-started.md
β β βββ advanced-topics.md
β βββ <your-section>/
β βββ overview.md
β βββ getting-started.md
β βββ advanced-topics.md
β βββ GoGrab-Space/ # Example root project (private or public scope)
β βββ index.md # Project landing
β βββ apps/ # Example app (gograb-space)
β βββ gograb-space/ # Example app (gograb-space)
β βββ index.md # App landing
β βββ platform/ # Example platform (gograb-space-platform)
β βββ features/
β βββ generative-ai/
β βββ graphs/
β β βββ index.md
β β βββ D3/
β β βββ mermaid/
β βββ miscellaneous/
β β βββ index.md
β β βββ miscellaneous.index.md
β β βββ ai-generated/
β βββ troubleshooting/
β βββ index.md
βββ spanish/
βββ GoGrab-Space/
β βββ index.mdc
β βββ apps/
β βββ core-libs/
β βββ libs/
βββ public/
βββ index.es.md
βββ api/
β βββ mock-api/
β βββ index.md
βββ backend-api/
βββ components/
βββ desarrollo/
βββ documentacion/
βββ GoGrab-Space/
β βββ sistema-almacenamiento/
βββ la-plataforma/
βββ libs/
βββ miscellaneous/
β βββ miscellaneous.index.es.md
βββ next-steps/
β βββ index.es.md
βββ plan/
β βββ index.md
βββ platform/
βββ sistema-almacenamiento/
β βββ firebase/
β βββ index.md
βββ solucion-problemas/
βββ widgets/
βββ yam/
βββ ai/
Current Active Root: docs/
With the current configuration (docsPath: 'docs'), the actual structure is:
docs/
βββ english/
β βββ Ai-instructions/
β β βββ ai-instructions-index.md
β βββ Ai-Process/
β βββ Architecture/
β β βββ ecosystem/
β βββ Backend-Api/
β β βββ index.md
β β βββ progress-notes/
β βββ docs-angular-docs/
β β βββ add-documentation.md # This file
β βββ docs-to-review/
β βββ GoGrab-Pulse/
β β βββ index.mdc
β β βββ artists/
β β βββ guides/
β β βββ intro/
β βββ GoGrab-Space/
β βββ GoGrab-Space-Deck-md/
β βββ private/
β βββ public/
β βββ index.md
β βββ development/
β β βββ index.md
β β βββ angular/
β β βββ building/
β β βββ common-errors/
β β β βββ index.md
β β βββ css-dev/
β β β βββ index.md
β β βββ debugging/
β β βββ directives/
β β β βββ index.md
β β βββ html/
β β βββ libraries/
β β β βββ index.md
β β β βββ troubleshooting/
β β βββ monorepo/
β β βββ NX/
β β βββ performance/
β β βββ styles/
β β βββ tools-docs/
β β β βββ scripts-maybe-deprecated/
β β βββ typescript/
β β βββ zsh/
β βββ features/
β βββ generative-ai/
β βββ graphs/
β β βββ index.md
β β βββ D3/
β β βββ mermaid/
β βββ miscellaneous/
β β βββ index.md
β β βββ miscellaneous.index.md
β β βββ ai-generated/
β βββ troubleshooting/
β βββ index.md
β βββ quick-reference/
βββ spanish/
βββ GoGrab-Space/
β βββ index.mdc
β βββ apps/
β βββ core-libs/
β βββ libs/
βββ public/
βββ index.es.md
βββ api/
β βββ mock-api/
β βββ index.md
βββ backend-api/
βββ components/
βββ desarrollo/
βββ documentacion/
βββ GoGrab-Space/
β βββ sistema-almacenamiento/
βββ la-plataforma/
βββ libs/
β βββ sistemas/
β βββ sistema-iconos/
βββ miscellaneous/
β βββ miscellaneous.index.es.md
βββ next-steps/
β βββ index.es.md
βββ plan/
β βββ index.md
βββ platform/
βββ sistema-almacenamiento/
β βββ firebase/
β βββ index.md
βββ solucion-problemas/
βββ widgets/
βββ yam/
βββ ai/
Creating Documentation Files
β οΈ IMPORTANT: Use the configured documentation root from
docs-config.ts. Currently set to:docs/
Single Document
# Create a single markdown file (English) - Using current configured root
touch docs/english/public/my-new-guide.md
# Create a Spanish placeholder (recommended)
touch docs/spanish/public/mi-nueva-guia.es.md
# Alternative: Using fallback location
touch apps/docs-angular/src/assets/docs/english/public/my-new-guide.md
Organized Section with Multiple Files
# Create a new directory for organized documentation (English) - Using current configured root
mkdir -p docs/english/public/my-section
# Create individual files
touch docs/english/public/my-section/index.md
touch docs/english/public/my-section/overview.md
touch docs/english/public/my-section/getting-started.md
touch docs/english/public/my-section/advanced-topics.md
# Optional Spanish placeholders
mkdir -p docs/spanish/public/mi-seccion
touch docs/spanish/public/mi-seccion/index.es.md
# Alternative: Using fallback location
mkdir -p apps/docs-angular/src/assets/docs/english/public/my-section
touch apps/docs-angular/src/assets/docs/english/public/my-section/index.md
Markdown File Best Practices
File Naming Convention
- Use kebab-case:
my-awesome-guide.mdβ - Avoid spaces:
My Awesome Guide.mdβ - Be descriptive:
setup-guide.mdβ vsguide.mdβ
Header Structure for Navigation
# Main Title
## Section One
Content for section one...
## Section Two
Content for section two...
### Subsection
Subsection content...
π¨ IMPORTANT: Headers generate fragment IDs automatically:
## Widget Economyβ#widget-economy## Development Roadmapβ#development-roadmap- Keep headers simple and clean for reliable fragment links
π§ Step 2: Navigation & Routes (Automatic)
- Navigation is auto-generated from the file system by the discovery/manifest services. No manual edits are needed.
- Routes are dynamic and handled by a catchβall route that renders the dynamic page component.
- URLs derive from language + project scope + relative path:
- Public docs (EN):
english/public/my-section/overview.mdβ/my-section/overview - Public docs (ES):
spanish/public/mi-seccion/overview.es.mdβ/es/mi-seccion/overview - Project docs (EN):
english/GoGrab-Pulse/guides/setup.mdβ/GoGrab-Pulse/guides/setup - Project landing via
index.md:english/GoGrab-Pulse/index.mdβ/GoGrab-Pulse - Section landing via
index.md:english/public/my-section/index.mdβ/my-section
- Public docs (EN):
π§ Routing Details
- The app uses universal dynamic routes; no manual route additions are needed.
- URLs derive from file paths; fragments like
#important-conceptsmap to headers. - Language prefixes are automatic (
/esfor Spanish, none for English). Prefer placing files under language folders over suffixing.es.md.
english/public/my-section/overview.md β /my-section/overview
english/public/my-section/index.md β /my-section
spanish/public/mi-seccion/overview.es.md β /es/mi-seccion/overview
english/GoGrab-Pulse/guides/setup.md β /GoGrab-Pulse/guides/setup
english/GoGrab-Pulse/index.md β /GoGrab-Pulse
π§Ύ Templates
Template 1: Minimal
---
title: Widget Builder Overview
description: Introduction to building widgets
icon: π§©
order: 1
created: December 2, 2025 - 2:30 PM
sessionID: 1
status: π― In Progress
---
# Title
Content for the page...
## Section One
Content for section one...
## Section Two
Content for section two...
### Subsection
Subsection content...
π§Ύ Frontmatter Templates
Minimal (recommended)
---
title: Widget Builder Overview
description: Introduction to building widgets
icon: π§©
order: 1
created: December 2, 2025 - 2:30 PM
sessionID: 1
---
Advanced metadata
---
title: Component Factory Reference
description: Complete API reference for the ComponentFactory
icon: π§
order: 3
created: December 2, 2025 - 2:30 PM
updated: December 2, 2025 - 3:00 PM
sessionID: 1
tags: [angular, components, api]
author: Platform Team
status: published
difficulty: intermediate
estimatedReadTime: 8
toc: true
searchable: true
breadcrumbs: true
sidebar: true
layout: guide
version: 1.2.0
---
Session ID
Simple: Just a number that increments (1, 2, 3...)
Read docs/sessionID.json to get the current number.
Cross-language linking
---
title: LanguageβAware Discovery & Navigation
description: How navigation and routes adapt to the selected language
sessionID: 12-01-1-2
crossLanguageId: language-aware-discovery
languageVersions:
en: documentation/language-aware-discovery-and-navigation
es: documentacion/language-aware-discovery-and-navigation
---
Folder-level configuration (_folder.md)
---
title: Widgets
icon: π§©
order: 10
collapsed: false
---
Optional description content for the folder landing entry.
ποΈ File Types You Can Add
- index.md: Section landing page. Creates
/your-sectionroute. - overview.md / getting-started.md / any-page.md: Regular content pages.
- _folder.md: Folder-level frontmatter to set
title,icon,order,collapsedfor the section. - Language variants: Prefer language folders (
english/,spanish/). You may also suffix files with.en.mdor.es.mdwhen variants must live side-by-side in the same folder. - Project docs: Place files under the project directory (e.g.,
english/GoGrab-Pulse/...) to scope routes under/<ProjectName>/....
π Admin Capabilities (/admin)
Visit /admin inside docs-angular for administration tools.
- Authentication: Password-protected session with auto-expiration. Default dev password:
admin123(use environment configuration in production). - Configuration Editor (
/admin/config): Edit global/project-specific documentation settings, including:- Documentation root path (
docsPath) - Auto-discovery settings
- Recursive search configuration
- Maximum search depth
- Fallback paths management
- Documentation root path (
- Analytics Dashboard (
/admin/analytics): Page views, searches, average load time, popular pages, recent terms, and detailed per-page analytics (/admin/analytics/pages). - Docs Scanner Controls: Start/stop/restart
docs:watchand triggerdocs:scandirectly from the UI. Server APIs exposed via the internal admin proxy:POST /api/admin/docs/start-watchPOST /api/admin/docs/stop-watchPOST /api/admin/docs/restart-watchGET /api/admin/docs/watch-statusPOST /api/admin/docs/trigger-scan
- Quick Links: Access common destinations (home, config, analytics, source).
Modifying Documentation Root via Admin
You can change the documentation root location through the Admin Configuration Editor:
- Navigate to
/admin/config - Locate the
docsPathsetting - Update to your desired path (e.g.,
docs,documentation, orapps/docs-angular/src/assets/docs) - Save configuration
- Trigger a documentation rescan to apply changes
β οΈ Note: Changes to
docs-config.tsrequire the development server to restart to take effect.
Tips
- After adding files, trigger a manual scan from the Admin Dashboard to refresh navigation immediately
- The sidebar supports expand/collapse of sections;
_folder.mdcontrols defaults - Monitor the documentation scanner status to ensure files are being discovered correctly
π€ AI Agent Authoring & Placement Guide
Follow these strict rules when generating or moving documentation:
1) Get Session ID First
cat docs/sessionID.json
Use the sessionID number. New session? Increment by 1.
2) Check the documentation root configuration
- Read
apps/docs-angular/docs-config.tsto determine the activedocsPath - Current configuration:
docsPath: 'docs'(workspace root) - Fallback location:
apps/docs-angular/src/assets/docs/
3) Choose the correct language and project
- English β under
<DOCS_ROOT>/english/...(currentlydocs/english/...) - Spanish β under
<DOCS_ROOT>/spanish/...(currentlydocs/spanish/...) - Project-scoped docs β under the project folder, e.g.,
<DOCS_ROOT>/english/GoGrab-Pulse/... - Public/shared docs β under
<DOCS_ROOT>/english/public/...
4) Create the right files
- Use
index.mdfor section or project landings (creates/sectionor/Project) - Use descriptive kebab-case filenames for content pages
- Add a Spanish placeholder
.es.mdwhen instructed
5) Add frontmatter correctly
---
title: My Title
description: Brief description
icon: π
created: December 2, 2025 - 2:30 PM
sessionID: 1
order: 1
---
6) Verify links and routes
- Use relative links between pages within the same section or project
- For fragments, ensure headers are simple (no heavy formatting)
7) Refresh navigation
- Prefer
yarn serve:docs(auto-watch). Alternatively:/adminβ Run Scan
8) Never modify Angular routes or hardcode language prefixes
- Rely on dynamic routing and language-aware services
π Recent Performance Improvements
The documentation system has been significantly optimized for better performance and user experience:
β‘ Faster Loading Times
- Before: 30+ second loading times for some routes
- After: <100ms navigation with instant content loading
- Improvement: 99%+ reduction in loading time
π§ Enhanced File Detection
- Smart File Type Detection: Automatically prioritizes
.mdcfiles for project routes and.mdfiles for public routes .index.mdSupport: Now supports files likeux-test.index.mdfor better organization- Reduced 500 Errors: Eliminates failed requests for non-existent files
π Request Deduplication
- Infinite Loop Prevention: Prevents duplicate requests for the same content
- Memory Management: Proper cleanup of active requests
- Performance Optimization: Reduces server load and improves responsiveness
π Relative Link Resolution
- Monorepo-Aware Links:
../libs-structuralautomatically converts to/GoGrab-Space/libs-structural - Context-Aware Processing: Links work correctly within project boundaries
- Smart Path Resolution: Handles both
../and./relative link patterns
π Writing Links in Documentation
The docs-angular system intelligently handles both internal and external links with different behaviors:
β‘ Internal Links (Fast Client-Side Navigation)
Use absolute paths starting with / for internal documentation:
[Documentation Guide](/documentation/add-documentation)
[Getting Started](/getting-started)
[Theme System](/GoGrab-Space/theme-system)
[Apps Overview](/apps)
β Benefits:
- β‘ Fast navigation - No page reload, instant Angular routing
- π― Smooth transitions - Beautiful animations between pages
- π± Better UX - Maintains scroll position and application state
- π Browser history - Proper back/forward button support
π Internal Links in New Tab
To open internal documentation in a new tab within the docs-angular app, add "new tab" in the title:
[Documentation Guide](/documentation/add-documentation "Open in new tab")
[Theme System](/GoGrab-Space/theme-system "new tab")
[Apps Overview](/apps "Open this in new tab")
β Features:
- π New tab icon - Visual indicator for new tab links
- π± Same app - Opens within docs-angular, not external browser tab
- β‘ Fast loading - Still uses Angular routing, just in new window
- π― Perfect for comparisons - Keep multiple docs open simultaneously
π External Links (Open in New Tab)
External links automatically open in new tabs with a visual indicator:
[Angular Documentation](https://angular.dev)
[GitHub Repository](https://github.com/your-repo)
[Email Contact](mailto:[email protected])
[Phone Number](tel:+1234567890)
β Features:
- π External link icon - Visual indicator shows it's external
- π New tab - Opens in new tab with
target="_blank" - π Security - Includes
rel="noopener noreferrer"for safety - π± Smart detection - Automatically detects external URLs
π Anchor Links (Same Page Sections)
Link to sections within the same page:
[Jump to Section](#section-name)
[Configuration Details](#configuration-details)
[Common Issues](#common-issues--solutions)
β Auto-generated anchors:
- Headers automatically become linkable anchors
- Use kebab-case format:
## My Sectionβ#my-section - Copy link button on H2 headers for easy sharing
π― Link Best Practices
β DO:
<!-- Internal links with absolute paths -->
[Documentation](/documentation)
[Apps Guide](/apps/singularity)
<!-- External links with full URLs -->
[Angular Docs](https://angular.dev)
[GitHub](https://github.com/user/repo)
<!-- Anchor links with proper format -->
[See Configuration](#configuration-section)
β DON'T:
<!-- Relative paths (cause routing issues) -->
[Guide](./guide.md)
[Parent](../parent.md)
<!-- File extensions (not needed) -->
[Guide](/documentation/guide.md)
<!-- Hardcoded language prefixes -->
[Spanish Guide](/es/documentation/guide)
π How Link Detection Works
The system automatically determines link types:
External Links - Detected by:
- URLs starting with
http://orhttps:// - URLs with
mailto:ortel:protocols - URLs containing domains (dots without leading slash)
- URLs starting with
Internal Links - Everything else:
- Paths starting with
/(absolute paths) - Anchor links starting with
# - Relative paths (though not recommended)
- Paths starting with
π Performance Benefits
Internal Links:
- β‘ Instant navigation - No server requests
- π¨ Smooth animations - Page transitions
- πΎ State preservation - Maintains application state
- π± Better mobile experience - No loading delays
External Links:
- π Security - Safe external navigation
- π― User clarity - Visual indication of external links
- π± Context preservation - Keeps docs open in original tab
π§ Common Issues & Solutions
Issue 1: Fragment Links Not Working
Problem: Links like #section-name don't scroll to the correct section
Solution: Ensure headers are simple and clean
<!-- β
GOOD - Simple headers -->
## Widget Economy
## Development Roadmap
## Immediate Action Plan
<!-- β BAD - Complex headers with formatting -->
## π§© **WIDGET ECONOMY ARCHITECTURE**
## πΊοΈ **THE DEVELOPMENT ROADMAP**
Issue 2: File Not Loading (Shows Fallback Content)
Problem: Navigation link goes to page but shows generic fallback content
Solution: Check path consistency and verify the configured documentation root
// Navigation link
{ text: 'My Guide', link: '/my-guide' }
// Route path
{ path: 'my-guide', ... }
// File location (check docs-config.ts for active root)
docs/english/public/my-guide.md // Current configured root
// OR
apps/docs-angular/src/assets/docs/english/public/my-guide.md // Fallback location
Issue 3: URL Encoding in Fragments
Problem: URLs show %23section-name instead of #section-name
Solution: This is automatically handled by the dynamic-page.component.ts - fragments are stripped for content loading but preserved for navigation.
π Complete Example: Adding a New Feature Guide
Let's walk through adding a complete "Widget Builder Guide" using the configured documentation root:
Step 1: Create Files
# Using current configured root (docs/)
# Create directory structure
mkdir -p docs/english/public/guides/widget-builder
# Create documentation files
touch docs/english/public/guides/widget-builder/overview.md
touch docs/english/public/guides/widget-builder/creating-widgets.md
touch docs/english/public/guides/widget-builder/advanced-features.md
# Alternative: Using fallback location
mkdir -p apps/docs-angular/src/assets/docs/english/public/guides/widget-builder
touch apps/docs-angular/src/assets/docs/english/public/guides/widget-builder/overview.md
Step 2: Write Content
<!-- docs/english/public/guides/widget-builder/overview.md -->
---
title: Widget Builder Guide
description: Complete guide to building widgets
icon: π§©
order: 1
---
# Widget Builder Guide
## Introduction
Welcome to the comprehensive Widget Builder guide...
## Getting Started
Here's how to start building widgets...
## Core Concepts
Understanding the widget architecture...
Step 3: Refresh Navigation (optional)
Use the Admin Dashboard β Documentation Management β Run Scan to refresh immediately, or rely on the watch process.
β Verification Checklist
After adding new documentation, verify everything works:
File Structure Check
- Markdown files are in the correct directory
- File names use kebab-case
- Directory structure is logical and organized
Navigation Check
- New pages appear automatically in the sidebar
- Links match the file paths
-
_folder.mdcontrols section icon/order/collapsed - Fragment links work for section navigation
Route Check
- Dynamic routes render pages at expected URLs
- Language prefixing works (
/es/...) - Section landing pages work via
index.md
Content Check
- Markdown renders properly
- Headers are simple and clean (for fragment links)
- Links work correctly
- Code blocks have proper syntax highlighting
- Images and assets load correctly
π Advanced Tips
Organizing Large Documentation Sets
<DOCS_ROOT>/ # Currently: docs/
βββ english/
β βββ public/
β βββ feature-name/
β βββ overview.md (main entry point)
β βββ getting-started.md
β βββ configuration.md
β βββ api-reference.md
β βββ troubleshooting.md
Configuration Management
// apps/docs-angular/docs-config.ts
export const DOCS_CONFIG = {
docsPath: 'docs', // Change this to modify root location
autoDiscovery: false, // Enable for automatic discovery
recursiveSearch: true, // Search nested directories
maxSearchDepth: 3, // Limit search depth
fallbackPaths: [ // Backup locations
"apps/docs-angular/src/assets/docs"
]
}
Using Consistent Naming Patterns
- Overview documents:
overview.md,introduction.md - Tutorial documents:
getting-started.md,quick-start.md - Reference documents:
api-reference.md,configuration.md - Help documents:
troubleshooting.md,faq.md
Markdown Enhancement Features
The docs system supports:
- β Syntax highlighting in code blocks
- β Automatic table of contents generation
- β Fragment link navigation
- β Search functionality
- β Responsive design
Performance Considerations
- Content is cached after first load
- Images should be optimized (use WebP when possible)
- Large documents should be split into sections
- Fragment navigation is handled automatically
π― Summary
Adding documentation is a streamlined 2-step process with automatic routing:
- βοΈ Check Configuration: Verify the active documentation root in
apps/docs-angular/docs-config.ts(currently:docs/) - π Create Files: Add markdown files with proper frontmatter in the configured location
- π Automatic Processing: Navigation and routes are generated automatically via discovery services
Key Points to Remember:
- β
Always check
docs-config.tsfor the active documentation root - β
Use the configured path (
docs/) or fallback location (apps/docs-angular/src/assets/docs/) - β Keep headers simple for reliable fragment links
- β Organize files logically with language-first structure
- β Test navigation after adding new content
- β Use Admin Dashboard to trigger manual scans if needed
Configuration Flexibility: The system supports flexible documentation root configuration, allowing you to:
- Store docs in workspace root (
docs/) for centralized management - Use app-specific location (
apps/docs-angular/src/assets/docs/) for legacy support - Configure fallback paths for multi-location support
- Adjust discovery settings (depth, recursion, auto-discovery)
Follow this guide and your documentation will integrate seamlessly with the docs-angular application!
Guide created based on GoGrab Space documentation implementation experience
Last updated: December 2025
Session ID: 1