# MinimalDoc > A minimal static site generator for documentation. Fast, clean, and easy to use. > > This file contains the complete documentation. ## Feature Index *Complete list of all MinimalDoc features* ### Feature Index Complete list of all MinimalDoc features with one-liner descriptions. #### Content | Feature | Description | |---------|-------------| | Markdown | GitHub Flavored Markdown with tables, task lists, strikethrough | | Frontmatter | YAML metadata for title, description, tags, SEO, ordering | | Admonitions | Callout blocks: info, warning, danger, success, note, question | | Syntax Highlighting | 100+ languages via Chroma with one-click copy | | Stale Warnings | Configurable warnings for content older than N days | | Link Checking | Validate internal/external links during build | | Anchor Links | Auto-generated heading IDs for deep linking | | External Links | Auto-open in new tab with visual indicator | #### Navigation | Feature | Description | |---------|-------------| | Auto Navigation | Generated from folder structure with numeric prefixes | | Custom TOC | Override navigation order via TOC.md file | | Page TOC | Right sidebar table of contents from headings | | Scrollspy | Active heading highlight while scrolling | | Collapsible Sections | Expand/collapse navigation groups with state persistence | | Breadcrumbs | Path navigation in Knowledge Base and versioned docs | #### Search | Feature | Description | |---------|-------------| | Full-Text Search | Client-side inverted index with weighted scoring | | Keyboard Shortcut | Cmd+K / Ctrl+K to open search modal | | Prefix Matching | Find results while typing partial words | | Section Results | Jump directly to matching headings within pages | | Per-Version Index | Separate search indexes for each documentation version | | KB/FAQ Indexing | Knowledge Base and FAQ items included in search | #### Design | Feature | Description | |---------|-------------| | Responsive | Mobile, tablet, desktop layouts with hamburger menu | | Dark Mode | Toggle with localStorage persistence and system preference | | Built-in Themes | Default (neutral) and Yellow themes included | | Custom Colors | Configure all color variables in YAML | | Custom Fonts | Google Fonts integration via config | | Hero Backgrounds | Background images with overlay for landing pages | | Skip Links | Accessibility: skip to main content link | | Focus Indicators | Visible focus states for keyboard navigation | #### Pages | Feature | Description | |---------|-------------| | Landing Page | Marketing homepage with hero, features, steps, CTA sections | | Markdown Landing | Define landing sections in `__landing__/*.md` files | | Knowledge Base | Self-service support hub with categories and article counts | | Portfolio | Project showcase with tags, images, and filtering | | Contact | Contact information page with email and details | | FAQ | Collapsible Q&A with categories and deep linking | | Legal | Privacy policy, terms of service with auto footer links | | Status Page | Service health dashboard with incidents and maintenance | | Changelog | Version history with categories and RSS feed | #### Versioning | Feature | Description | |---------|-------------| | Multi-Version | Maintain docs for multiple software versions | | Version Selector | Dropdown to switch between versions | | Version Overrides | Override specific pages in `__versions__/{version}/` | | EOL Warnings | Warning banners for end-of-life versions | | Since/Deprecated | Badges showing when features were added or deprecated | | Per-Version Search | Separate search indexes per version | #### Internationalization | Feature | Description | |---------|-------------| | Multi-Locale | Support multiple languages with locale selector | | Translation Files | Translations in `__translations__/{locale}/` directory | | Fallback Content | Show default locale content when translation missing | | RTL Support | Right-to-left text direction for Arabic, Hebrew, etc. | | Locale Persistence | Remember language preference in localStorage | | URL Prefixes | SEO-friendly `/fr/`, `/de/` URL structure | #### API Documentation | Feature | Description | |---------|-------------| | OpenAPI Support | Interactive docs from OpenAPI/Swagger specs | | Multiple Views | Organize endpoints by path, tag, or flat list | | Live Testing | Interactive API tester with auth support | | Code Samples | Auto-generated curl, JavaScript, Go, Python, Swift | | Schema Viewer | Collapsible explorer for complex types | | Response Tabs | Tabbed interface for different status codes | | Export | Generate cURL commands and restcli configs | #### Status Page | Feature | Description | |---------|-------------| | Component Status | Track services with operational/degraded/outage states | | Incident Timeline | Markdown incidents with update history | | Maintenance Windows | Display scheduled maintenance with dates | | Uptime Calendar | 90-day visual uptime grid (GitHub-style) | | SLA Display | Track targets with 7d/30d/90d breakdowns | | Health Checks | Browser-based endpoint polling with latency | | RSS Feed | Subscribe to incident updates | | JSON API | Machine-readable status at `/status/status.json` | #### SEO | Feature | Description | |---------|-------------| | Sitemap | Automatic sitemap.xml with all pages | | Meta Tags | Title, description, author, keywords | | Open Graph | Facebook/LinkedIn preview cards | | Twitter Cards | Twitter preview cards | | Canonical URLs | Configurable canonical link tags | | Robots Meta | noindex/nofollow per page | | LLM Output | llms.txt and llms-full.txt for AI assistants | #### Analytics | Feature | Description | |---------|-------------| | Plugin System | Multiple providers can run simultaneously | | Google Analytics 4 | Native support with measurement ID | | Plausible | Privacy-friendly analytics (hosted or self-hosted) | | Umami | Open-source analytics support | | Matomo | Self-hosted analytics support | | Fathom | Privacy-focused analytics | | Simple Analytics | Minimal tracking solution | | Custom Provider | Arbitrary script injection with custom attributes | #### Build | Feature | Description | |---------|-------------| | Single Binary | No dependencies, just one executable | | Fast Builds | Go-powered, handles large sites quickly | | Single File Mode | Build one markdown file as standalone page | | Config File | Optional config.yaml for persistent settings | | CLI Overrides | All config options available as flags | | Clean URLs | Optional `/page/` instead of `/page.html` | | Custom Entrypoint | Use README.md or any file as homepage | | Version Check | `minimaldoc version --check` for updates | #### Output | Feature | Description | |---------|-------------| | Static HTML | Pure HTML/CSS/JS, no server runtime | | Asset Copying | Static files copied from docs directory | | Icons SVG | Social and UI icons as SVG sprite | | Version Badge | "Powered by MinimalDoc" footer link | | Source Maps | CSS source maps for debugging | ## CLI Commands *Command-line interface reference* ### CLI Commands MinimalDoc command-line interface reference. #### Commands | Command | Description | |---------|-------------| | `build` | Build documentation site | | `init` | Initialize new documentation | | `version` | Show version | | `help` | Show help | #### build Generate static HTML from Markdown files. ```bash minimaldoc build [docs-directory] [flags] ``` ##### Arguments | Argument | Default | Description | |----------|---------|-------------| | `docs-directory` | `.` | Path to documentation source or a single .md file | ##### Single File Mode Build a single markdown file as a standalone page: ```bash minimaldoc build README.md ``` When a `.md` file is passed instead of a directory, MinimalDoc generates only that file as `index.html`. ##### Flags | Flag | Short | Type | Default | Description | |------|-------|------|---------|-------------| | `--output` | `-o` | string | `public` | Output directory | | `--theme` | `-t` | string | `default` | Theme name | | `--title` | | string | `Documentation` | Site title | | `--description` | | string | | Site description | | `--base-url` | | string | | Base URL for absolute links | | `--llms` | `-l` | bool | `true` | Generate llms.txt | | `--clean-urls` | | bool | `false` | Use clean URLs | | `--openapi` | | bool | `false` | Enable OpenAPI docs | | `--openapi-dir` | | string | `api` | OpenAPI specs directory | | `--status` | | bool | `false` | Enable status page | | `--status-title` | | string | `Service Status` | Status page title | | `--status-path` | | string | `status` | Status page output path | | `--changelog` | | bool | `false` | Enable changelog | | `--changelog-title` | | string | `Changelog` | Changelog page title | | `--changelog-path` | | string | `changelog` | Changelog output path | | `--stale-warning` | | bool | `false` | Enable stale warnings | | `--stale-threshold` | | int | `365` | Days before stale | | `--link-check` | | string | `warn` | Link check mode: error, warn, ignore | | `--check-external` | | bool | `false` | Validate external URLs | | `--mcp` | | bool | `false` | Enable MCP server documentation | | `--mcp-dir` | | string | `mcp` | MCP manifests directory | | `--force` | | bool | `false` | Overwrite output directory without build marker | ##### Examples **Basic build:** ```bash minimaldoc build ``` **Specify source directory:** ```bash minimaldoc build ./docs ``` **Custom output:** ```bash minimaldoc build ./docs --output dist ``` **Production build:** ```bash minimaldoc build ./docs \ --base-url "https://docs.example.com" \ --output dist ``` **Full featured:** ```bash minimaldoc build ./docs \ --title "My Project" \ --description "Project documentation" \ --base-url "https://docs.example.com" \ --output dist \ --theme default \ --openapi \ --status \ --changelog \ --clean-urls ``` **Disable features:** ```bash minimaldoc build ./docs \ --llms=false \ --stale-warning=false ``` **Strict link checking (CI/CD):** ```bash minimaldoc build ./docs --link-check=error ``` **Skip link checking:** ```bash minimaldoc build ./docs --link-check=ignore ``` **Check external URLs:** ```bash minimaldoc build ./docs --check-external ``` #### init Initialize a new documentation site with example files and optional features. ```bash minimaldoc init [directory] [flags] ``` ##### Arguments | Argument | Default | Description | |----------|---------|-------------| | `directory` | `docs` | Target directory | ##### Flags | Flag | Description | |------|-------------| | `--with-toc` | Create TOC.md for custom navigation | | `--with-status` | Create status page structure | | `--with-changelog` | Create changelog structure | | `--with-openapi` | Create OpenAPI specification example | | `--full` | Include all optional features | ##### Generated Structure **Basic (default):** ``` docs/ ├── config.yaml ├── index.md ├── getting-started/ │ ├── installation.md │ └── quick-start.md └── guides/ └── deployment.md ``` **Full (`--full` flag):** ``` docs/ ├── config.yaml ├── TOC.md ├── index.md ├── getting-started/ │ ├── installation.md │ └── quick-start.md ├── guides/ │ └── deployment.md ├── api/ │ └── openapi.yaml ├── __status__/ │ ├── components.yaml │ ├── incidents/ │ │ └── YYYY-MM-DD-example-incident.md │ └── maintenance/ └── __changelog__/ └── releases/ └── 0.1.0.md ``` ##### Examples **Basic site:** ```bash minimaldoc init ``` **Custom directory:** ```bash minimaldoc init my-docs ``` **With all features:** ```bash minimaldoc init my-docs --full ``` **With specific features:** ```bash minimaldoc init my-docs --with-status --with-openapi ``` **API documentation project:** ```bash minimaldoc init api-docs --with-openapi --with-changelog ``` #### version Show MinimalDoc version and check for updates. ```bash minimaldoc version [flags] ``` Output: ``` minimaldoc version 1.0.0 ``` ##### Flags | Flag | Description | |------|-------------| | `--check` | Check GitHub for newer releases | ##### Examples **Show version:** ```bash minimaldoc version ``` **Check for updates:** ```bash minimaldoc version --check ``` When an update is available: ``` minimaldoc version 1.0.0 Checking for updates... Update available: 1.0.0 -> 1.1.0 Release URL: https://github.com/studiowebux/minimaldoc/releases/tag/v1.1.0 To update: go install github.com/studiowebux/minimaldoc/cmd/minimaldoc@latest Or download from GitHub releases. ``` #### help Show help for any command. ```bash minimaldoc help [command] ``` ##### Examples ```bash minimaldoc help minimaldoc help build minimaldoc build --help ``` #### Global Flags Available for all commands: | Flag | Description | |------|-------------| | `--help` | Show help | | `--version` | Show version | #### Exit Codes | Code | Description | |------|-------------| | 0 | Success | | 1 | General error | | 2 | Invalid arguments | | 3 | File not found | | 4 | Build error | #### Environment Variables | Variable | Description | |----------|-------------| | `MINIMALDOC_CONFIG` | Path to config file | | `MINIMALDOC_THEME` | Theme name | | `NO_COLOR` | Disable colored output | #### Configuration Precedence 1. CLI flags (highest priority) 2. Environment variables 3. config.yaml 4. Defaults (lowest priority) #### Shell Completion Generate completion scripts: ```bash # Bash minimaldoc completion bash > /etc/bash_completion.d/minimaldoc # Zsh minimaldoc completion zsh > "${fpath[1]}/_minimaldoc" # Fish minimaldoc completion fish > ~/.config/fish/completions/minimaldoc.fish # PowerShell minimaldoc completion powershell > minimaldoc.ps1 ``` #### Common Patterns ##### Development ```bash # Quick build for local preview minimaldoc build ./docs # Serve locally python -m http.server -d public 8080 ``` ##### CI/CD ```bash # Production build with all features minimaldoc build ./docs \ --base-url "$DOCS_URL" \ --output dist \ --openapi \ --status \ --changelog ``` ##### Docker ```bash # Build in container docker run -v $(pwd):/app -w /app golang:1.26-alpine sh -c \ "go install github.com/studiowebux/minimaldoc/cmd/minimaldoc@latest && \ minimaldoc build ./docs --output dist" ``` ## Changelog Overview *Track releases with versioned changelog* ### Changelog Overview MinimalDoc includes a changelog system for documenting releases. #### Features | Feature | Description | | ------------------ | ------------------------------ | | Versioned Releases | Semver-sorted release notes | | Categories | Added, Changed, Fixed, etc. | | Compare Links | Link to diffs between versions | | RSS Feed | Subscribe to releases | | JSON API | Machine-readable changelog | #### Quick Start 1. Create changelog directory: ``` docs/ ├── config.yaml # Changelog settings here └── __changelog__/ └── releases/ ├── 1.0.0.md └── 0.1.0.md ``` 2. Enable in config: ```yaml changelog: enabled: true title: "Changelog" path: "changelog" repository: "https://github.com/org/repo" ``` 3. Build: ```bash minimaldoc build --changelog ``` #### Directory Structure ``` docs/ ├── config.yaml # Changelog settings └── __changelog__/ └── releases/ ├── 2.0.0.md # Newest ├── 1.1.0.md ├── 1.0.0.md └── 0.1.0.md # Oldest ``` Releases sorted by semver, newest first. #### Generated Output ``` public/ └── changelog/ ├── index.html # All releases ├── 1.0.0.html # Individual release ├── feed.xml # RSS feed └── changelog.json # JSON API ``` #### Configuration ##### Site Config ```yaml changelog: enabled: true title: "Changelog" path: "changelog" rss_enabled: true repository: "https://github.com/org/repo" ``` | Option | Default | Description | | ------------- | ------------- | -------------------------------- | | `enabled` | `false` | Enable changelog | | `title` | `"Changelog"` | Page title | | `path` | `"changelog"` | Output path | | `rss_enabled` | `true` | Generate RSS feed | | `repository` | `""` | Repository URL for compare links | #### Compare Links With repository configured, each release shows diff link: ``` v1.1.0 [Compare] ``` Links to: ``` https://github.com/org/repo/compare/v1.0.0...v1.1.0 ``` #### RSS Feed Subscribe at `/changelog/feed.xml`: ```xml Changelog v1.1.0 Tue, 28 Jan 2025 00:00:00 GMT Added: Feature A, Feature B... ``` #### JSON API Machine-readable at `/changelog/changelog.json`: ```json { "releases": [ { "version": "1.1.0", "date": "2025-01-28", "title": "Feature Update", "url": "/changelog/1.1.0.html", "categories": { "added": ["Feature A", "Feature B"], "fixed": ["Bug fix #123"] } } ] } ``` #### Keep a Changelog Format Based on [keepachangelog.com](https://keepachangelog.com): - Changelogs are for humans, not machines - Every version should have an entry - Group changes by type - Versions should be linkable - Latest version comes first - Release date for each version #### Next Steps - [Format](02-format.md) - Release file format and categories ## Project Structure *Understanding MinimalDoc directory layout and file organization* ### Project Structure #### Directory Layout ``` docs/ ├── config.yaml # All site configuration ├── TOC.md # Custom navigation (optional) ├── index.md # Homepage ├── getting-started/ # Section directory │ ├── 01-installation.md # Ordered page │ └── 02-quick-start.md ├── guides/ │ └── deployment.md ├── api/ # OpenAPI specs (if enabled) │ └── openapi.yaml ├── __status__/ # Status page content │ ├── components.yaml │ ├── incidents/ │ └── maintenance/ ├── __changelog__/ # Changelog content │ └── releases/ ├── __portfolio__/ # Portfolio projects │ └── project-name.md ├── __faq__/ # FAQ markdown files (optional) │ ├── general/ │ │ └── what-is-this.md │ └── technical/ │ └── supported-languages.md └── __legal__/ # Legal pages ├── privacy.md └── terms.md ``` #### Reserved Directories | Directory | Purpose | |-----------|---------| | `__status__` | Status page (components, incidents, maintenance) | | `__changelog__` | Changelog releases | | `__portfolio__` | Portfolio project pages | | `__faq__` | FAQ questions as markdown files | | `__legal__` | Legal pages (privacy, terms, etc.) | | `api/` | OpenAPI specification files (configurable) | These directories are processed specially and don't appear in regular navigation. #### File Types | Extension | Processing | |-----------|------------| | `.md` | Markdown pages, converted to HTML | | `.yaml`, `.json` | Configuration and data files | | Other | Copied to output as static assets | #### Build Output ``` public/ ├── index.html # Landing or docs homepage ├── getting-started/ │ ├── installation.html │ └── quick-start.html ├── css/ │ └── main.css ├── js/ │ ├── search.js │ └── theme-toggle.js ├── search-index.json # Search index ├── sitemap.xml # SEO sitemap ├── llms.txt # LLM-friendly content ├── api/ # OpenAPI docs (if enabled) │ └── index.html ├── status/ # Status page (if enabled) │ ├── index.html │ ├── status.json │ └── feed.xml ├── changelog/ # Changelog (if enabled) │ ├── index.html │ └── feed.xml ├── projects/ # Portfolio (if enabled) │ └── index.html ├── contact/ # Contact page (if enabled) │ └── index.html ├── faq/ # FAQ page (if enabled) │ └── index.html └── legal/ # Legal pages (if enabled) ├── privacy/ │ └── index.html └── terms/ └── index.html ``` #### Naming Conventions ##### Numeric Prefixes Use numeric prefixes for ordering: ``` 01-introduction.md # Displays as "Introduction" 02-installation.md # Displays as "Installation" 10-advanced.md # Displays as "Advanced" ``` Prefixes are stripped from display titles and URLs: - `01-getting-started/` → `/getting-started/` - `02-quick-start.md` → `/quick-start.html` ##### Section Directories Directories become navigation sections: ``` getting-started/ # Section: "Getting Started" 01-intro.md # Page in section 02-install.md api-reference/ # Section: "API Reference" endpoints.md ``` #### Static Assets Place static files anywhere in your docs directory: ``` docs/ ├── images/ │ └── logo.png ├── downloads/ │ └── example.zip └── pages/ └── about.md ``` Reference in markdown: ```markdown ![Logo](/images/logo.png) [Download](/downloads/example.zip) ``` Assets are copied to output preserving directory structure. #### Hidden Files Files and directories starting with `.` or `_` are ignored: ``` docs/ ├── _drafts/ # Ignored │ └── wip.md ├── .private/ # Ignored └── published/ # Processed └── page.md ``` Exception: `__status__`, `__changelog__`, `__portfolio__`, `__faq__`, and `__legal__` use double underscores intentionally. ## Features Overview *Complete feature list and capabilities of MinimalDoc* ### Features Overview MinimalDoc provides everything needed for modern documentation sites. Pure static output designed for CI/CD integration—automate updates to documentation, status pages, and changelogs on every commit. #### Feature Matrix | Category | Feature | Description | Since | | -------------- | ------------------- | --------------------------------------------------------------- | ----- | | **Content** | Markdown | Full Markdown with GFM extensions | v1.0 | | | Frontmatter | YAML metadata for pages | v1.0 | | | Admonitions | Callout blocks (info, warning, danger, success, note, question) | v1.0 | | | Syntax Highlighting | 100+ languages via Chroma with copy button | v1.0 | | | Stale Warnings | Configurable warnings for outdated content | v1.0 | | | Link Checking | Validate internal/external links during build | v1.2 | | **Navigation** | Auto Navigation | From folder structure | v1.0 | | | Custom TOC | Via TOC.md file | v1.0 | | | Page TOC | Auto-generated from headings | v1.0 | | | Scrollspy | Active heading highlight | v1.0 | | **Search** | Full-Text | Client-side search index | v1.0 | | | Keyboard | Cmd+K / Ctrl+K shortcut | v1.0 | | | Fuzzy Matching | Tolerant search | v1.0 | | **Design** | Responsive | Mobile, tablet, desktop | v1.0 | | | Dark Mode | Toggle with localStorage persistence | v1.0 | | | Themes | CSS-only customization (default, yellow) | v1.0 | | | Custom Themes | Configure colors, fonts, backgrounds in YAML | v1.2 | | **Pages** | Landing | Marketing homepage with hero, features, steps | v1.0 | | | MD Landing Sections | Define landing sections in `__landing__/*.md` files | v1.1 | | | Portfolio | Project showcase with tags and filtering | v1.0 | | | Contact | Contact page with email and info | v1.0 | | | FAQ | Collapsible Q&A with categories and search integration | v1.0 | | | Legal | Privacy policy, terms of service with auto footer links | v1.0 | | | Knowledge Base | Self-service support hub with categories and scoped search | v1.1 | | | Status | Service health with incidents, maintenance, uptime | v1.0 | | | Changelog | Version history with RSS feed | v1.0 | | | Roadmap | Version-based timeline with tag filtering | v1.4 | | **Versioning** | Multi-Version | Documentation for multiple software versions | v1.2 | | | Version Selector | Dropdown to switch between versions | v1.2 | | | EOL Warnings | Warning banners for end-of-life versions | v1.2 | | **SEO** | Sitemap | Automatic sitemap.xml generation | v1.0 | | | Meta Tags | Open Graph, Twitter Cards | v1.0 | | | Canonical URLs | Configurable base URL | v1.0 | | | LLM Output | llms.txt and llms-full.txt generation | v1.0 | | **API** | OpenAPI | Interactive docs with testing UI (OAS 3.0 and 3.1) | v1.0 | | | Code Samples | curl, JavaScript, Go, Python, Swift | v1.0 | | | Schema Viewer | Request/response visualization | v1.0 | | | MCP Server Docs | Static reference pages from JSON manifests (no server needed) | v1.5 | #### Design Philosophy ##### Minimal Configuration Works out of the box. Add `config.yaml` only when needed. ```bash # This works minimaldoc build ./docs # Configuration optional minimaldoc build ./docs --title "My Docs" ``` ##### Static Output Pure HTML, CSS, JavaScript. No server runtime. ``` public/ ├── index.html # Static HTML ├── css/main.css # Compiled CSS ├── js/search.js # Vanilla JS └── ... ``` Deploy anywhere. ##### Build on Change No web server required. Content updates only when you push changes. Your CI/CD pipeline rebuilds the site, uploads static files, and you're done. No runtime costs, no database, no server maintenance. Data is generated and consumed only when needed. ``` git push → CI builds → Static files uploaded → Done ``` ##### CSS-Only Themes Themes are CSS variables only. No template editing. ```css :root[data-theme="light"] { --bg-primary: #fafafa; --text-primary: #1a1a1a; } ``` #### Core Strengths **Simplicity** - Single binary, no dependencies - Minimal configuration - Sensible defaults **Speed** - Fast builds (Go) - Small output (no framework bloat) - Client-side search (no server) **Documentation Focus** - Built for docs, not blogs - Navigation-first design - Technical content features **Integration Ready** - OpenAPI/Swagger native - Status page included - CI/CD friendly ## Installation *Install MinimalDoc on your system* ### Installation #### Prerequisites - Go 1.24 or later - Git (optional, for cloning) #### Install from Source ```bash git clone https://github.com/studiowebux/minimaldoc.git cd minimaldoc go build -o minimaldoc ./cmd/minimaldoc ``` Move the binary to your PATH: ```bash # macOS/Linux sudo mv minimaldoc /usr/local/bin/ # Or add to user bin mv minimaldoc ~/.local/bin/ ``` #### Go Install ```bash go install github.com/studiowebux/minimaldoc/cmd/minimaldoc@latest ``` Ensure `$GOPATH/bin` is in your PATH. #### Binary Releases Download pre-built binaries from the [releases page](https://github.com/studiowebux/minimaldoc/releases). Available for: - Linux (amd64, arm64) - macOS (amd64, arm64) - Windows (amd64) #### Verify Installation ```bash minimaldoc --version ``` Expected output: ``` minimaldoc version 1.0.0 ``` #### Shell Completion Generate shell completions: ```bash # Bash minimaldoc completion bash > /etc/bash_completion.d/minimaldoc # Zsh minimaldoc completion zsh > "${fpath[1]}/_minimaldoc" # Fish minimaldoc completion fish > ~/.config/fish/completions/minimaldoc.fish ``` #### Next Steps - [Quick Start](02-quick-start.md) - Create your first documentation site - [Configuration](03-configuration.md) - Configure your site ## Deployment *Deploy MinimalDoc sites to any static hosting* ### Deployment MinimalDoc generates static HTML that deploys anywhere. #### Build for Production ```bash minimaldoc build ./docs \ --base-url "https://docs.example.com" \ --output dist ``` Output in `dist/` is ready to deploy. #### Base URL Set `base_url` for correct absolute URLs: ```yaml # config.yaml base_url: https://docs.example.com ``` Or via CLI: ```bash minimaldoc build --base-url "https://docs.example.com" ``` Affects: - Sitemap URLs - Canonical links - Open Graph URLs - RSS feed links ##### Subdirectory Deployment For `/docs/` subdirectory: ```yaml base_url: https://example.com/docs ``` #### Clean URLs Enable for `/page/` instead of `/page.html`: ```yaml clean_urls: true ``` #### Hosting Can be deployed anywhere that supports Static files (HTML, JS, CSS, JSON) ## OpenAPI Overview *Interactive API documentation from OpenAPI/Swagger specifications* ### OpenAPI Overview MinimalDoc generates interactive API documentation from OpenAPI 3.x specifications. #### Features | Feature | Description | |---------|-------------| | Multiple Views | Organize by path, tag, or flat list | | Interactive Testing | Try API calls in browser | | Authentication | Bearer, API Key, OAuth 2.0 | | Code Samples | curl, JavaScript, Go, Python, Swift | | Schema Browser | Explore data models | | $ref Resolution | Automatic component reference resolution | | Export | Generate cURL commands | | Dark Mode | Full theme support | #### Quick Start 1. Place OpenAPI spec in `api/` directory: ``` docs/ └── api/ └── openapi.yaml ``` 2. Enable in config: ```yaml openapi: enabled: true spec_files: - "api/openapi.yaml" ``` 3. Build: ```bash minimaldoc build --openapi ``` #### Supported Formats | Format | Extension | |--------|-----------| | YAML | `.yaml`, `.yml` | | JSON | `.json` | #### OpenAPI Versions | Version | Support | |---------|---------| | OpenAPI 3.0.x | Full | | OpenAPI 3.1.x | Full | | Swagger 2.0 | Partial (convert to 3.x) | #### Generated Output ``` public/ ├── api/ │ ├── index.html # API documentation │ └── openapi.json # Processed spec └── ... ``` #### Example Spec ```yaml openapi: 3.0.3 info: title: My API version: 1.0.0 description: API for my service servers: - url: https://api.example.com/v1 description: Production paths: /users: get: summary: List users operationId: listUsers tags: - Users responses: '200': description: Successful response content: application/json: schema: type: array items: $ref: '#/components/schemas/User' components: schemas: User: type: object properties: id: type: integer name: type: string email: type: string format: email ``` #### Navigation Integration When OpenAPI is enabled, an "API Reference" link appears in the sidebar: ``` - Documentation - Getting Started - Features - API Reference # OpenAPI docs - Status # Status page (if enabled) ``` #### Multiple Specs Document multiple APIs: ```yaml openapi: enabled: true spec_files: - "api/v1/openapi.yaml" - "api/v2/openapi.yaml" - "api/admin/openapi.yaml" ``` Each generates a separate documentation page. #### Remote Specs Fetch specs from URLs: ```yaml openapi: enabled: true spec_urls: - "https://api.example.com/openapi.json" sync_on_build: true cache_dir: ".openapi-cache" ``` Cached locally to avoid repeated fetches. #### Next Steps - [Configuration](02-configuration.md) - Full configuration options - [Views](03-views.md) - Organize endpoints - [Testing](04-testing.md) - Try API calls - [Authentication](05-authentication.md) - Configure auth ## Status Page Overview *Service health dashboard with incidents and uptime tracking* ### Status Page Overview MinimalDoc includes a standalone status page for service health monitoring. #### Features | Feature | Description | | ---------------- | ------------------------- | | Component Status | Track multiple services | | Incidents | Document and track issues | | Maintenance | Schedule downtime windows | | Uptime Grid | 90-day visual display | | SLA Display | Track uptime percentages | | Health Checks | Live endpoint polling | | RSS Feed | Subscribe to updates | | JSON API | Machine-readable status | #### Quick Start 1. Create status directory: ``` docs/ ├── config.yaml # Status settings here └── __status__/ ├── components.yaml # Service definitions ├── incidents/ └── maintenance/ ``` 2. Enable in config: ```yaml status: enabled: true title: "Service Status" path: "status" ``` 3. Build: ```bash minimaldoc build --status ``` #### Directory Structure ``` docs/ ├── config.yaml # Site config (includes status settings) └── __status__/ ├── components.yaml # Service definitions ├── incidents/ │ └── YYYY-MM-DD-incident-name.md └── maintenance/ └── YYYY-MM-DD-maintenance-name.md ``` The `__status__` prefix avoids conflicts with documentation content. #### Generated Output ``` public/ └── status/ ├── index.html # Main dashboard ├── history.html # Incident history ├── incident/ │ └── *.html # Individual incidents ├── status.json # JSON API └── feed.xml # RSS feed ``` #### Status Dashboard The main dashboard displays: - Overall system status with color indicator - Component list grouped by category - Live health check results with latency (if configured) - Recent incidents section - Scheduled maintenance section - 90-day uptime grid per component #### Status Values | Status | Color | Description | | ---------------- | ------ | ------------------------- | | `operational` | Green | Fully functional | | `degraded` | Yellow | Reduced performance | | `partial_outage` | Orange | Some features unavailable | | `major_outage` | Red | Service unavailable | | `maintenance` | Blue | Planned maintenance | #### Overall Status Calculated from component statuses: | Components | Overall Status | | ------------------ | -------------------- | | All operational | Operational | | Any degraded | Degraded Performance | | Any partial outage | Partial Outage | | Any major outage | Major Outage | | Any in maintenance | Under Maintenance | #### Configuration Options ```yaml status: enabled: true title: "Service Status" description: "Current status of our services" path: "status" show_history: true history_months: 12 rss_enabled: true ``` | Option | Default | Description | | ---------------- | ------------------ | --------------------- | | `enabled` | `false` | Enable status page | | `title` | `"Service Status"` | Page title | | `description` | `""` | Page description | | `path` | `"status"` | Output path | | `show_history` | `true` | Show incident history | | `history_months` | `12` | Months of history | | `rss_enabled` | `true` | Generate RSS feed | #### Next Steps - [Components](02-components.md) - Define your services - [Incidents](03-incidents.md) - Document issues - [Maintenance](04-maintenance.md) - Schedule downtime - [Uptime Tracking](05-uptime-tracking.md) - Track availability ## Config Schema *Complete config.yaml schema reference* ### Config Schema Complete `config.yaml` schema reference. #### Full Schema ```yaml # Basic Settings title: string # Site title description: string # Site description base_url: string # Base URL for absolute links author: string # Default author # Theme theme: string # Theme name (default: "default") dark_mode: boolean # Default to dark mode (default: false) # Theme Configuration (config-based theming) theme_config: name: string # Custom theme name colors: light: # Light mode colors bg_primary: string # Main background bg_secondary: string # Secondary background bg_tertiary: string # Tertiary background bg_code: string # Code block background bg_hover: string # Hover state background text_primary: string # Main text text_secondary: string # Secondary text text_tertiary: string # Tertiary text text_muted: string # Muted text border_primary: string # Main borders border_secondary: string # Secondary borders accent_primary: string # Accent color accent_hover: string # Accent hover link_color: string # Link color link_hover: string # Link hover dark: # Dark mode colors (same fields) # ...same fields as light fonts: heading: string # Heading font family body: string # Body font family code: string # Code font family google_url: string # Google Fonts import URL hero: background_image: string # Hero background image URL background_overlay: string # Overlay color (e.g., "rgba(0,0,0,0.6)") text_align: string # Text alignment: left, center, right min_height: string # Minimum height (e.g., "80vh") # Features enable_llms: boolean # Generate llms.txt (default: true) enable_search: boolean # Enable search (default: true) clean_urls: boolean # Use /page/ URLs (default: false) nav_depth: integer # Max nav tree depth, 0=unlimited (default: 0) # MCP Server Documentation mcp: enabled: boolean # Enable MCP server docs (default: false) spec_files: [string] # Manifest file paths/globs (auto-discovers *.mcp.json if empty) path: string # Output URL path (default: "mcp") # OpenAPI Configuration openapi: enabled: boolean # Enable OpenAPI docs (default: false) spec_files: [string] # Local spec file paths spec_urls: [string] # Remote spec URLs default_view: string # View mode: path|tag|flat (default: "path") sync_on_build: boolean # Fetch remote specs (default: false) cache_dir: string # Cache directory (default: ".openapi-cache") enable_testing: boolean # Show Try It interface (default: true) enable_export: boolean # Enable cURL export (default: true) enable_code_samples: boolean # Show code samples (default: true) lazy_load_chunk_size: integer # Chunk size in bytes (default: 51200) # Status Page Configuration status: enabled: boolean # Enable status page (default: false) title: string # Page title (default: "Service Status") description: string # Page description path: string # Output path (default: "status") show_history: boolean # Show incident history (default: true) history_months: integer # Months of history (default: 12) rss_enabled: boolean # Generate RSS feed (default: true) # Changelog Configuration changelog: enabled: boolean # Enable changelog (default: false) title: string # Page title (default: "Changelog") path: string # Output path (default: "changelog") rss_enabled: boolean # Generate RSS feed (default: true) repository: string # Repository URL for compare links # Stale Warning Configuration stale_warning: enabled: boolean # Enable stale warnings (default: true) threshold_days: integer # Days before stale (default: 365) message: string # Custom warning message (default: built-in) show_update_date: boolean # Show last update (default: true) # Link Check Configuration link_check: enabled: boolean # Enable link checking (default: true) mode: string # Mode: error, warn, ignore (default: "warn") check_external: boolean # Check external URLs (default: false) external_timeout: integer # Timeout in seconds (default: 5) ignore_patterns: [string] # URL patterns to skip allowed_broken: [string] # Known broken links to ignore # Multi-Version Documentation versions: enabled: boolean # Enable multi-version docs (default: false) default: string # Default version name (e.g., "v2") list: # Available versions - name: string # Version identifier (e.g., "v2") label: string # Display label (e.g., "2.x (Latest)") path: string # URL path prefix eol: string # End of life date (YYYY-MM-DD) selector: position: string # Selector position: header, sidebar show_eol_warning: boolean # Show EOL warning banner (default: true) # Landing Page Configuration landing: enabled: boolean # Enable landing page (default: false) nav: [{text, url}] # Navigation links hero: title: string # Hero title subtitle: string # Hero subtitle buttons: [{text, url, primary}] features: title: string items: [{emoji, title, description}] steps: title: string items: [{title, description, code}] links: title: string items: [{icon, title, description, url}] opensource: title: string description: string links: [{text, url}] # Portfolio Configuration portfolio: enabled: boolean # Enable portfolio (default: false) title: string # Portfolio page title description: string # Portfolio description path: string # Output path (default: "projects") # Contact Configuration contact: enabled: boolean # Enable contact page (default: false) title: string # Contact page title description: string # Contact description path: string # Output path (default: "contact") email: string # Contact email info: [{icon, text}] # Info items (mail, location, phone) # FAQ Configuration faq: enabled: boolean # Enable FAQ page (default: false) title: string # FAQ page title (default: "FAQ") description: string # FAQ description path: string # Output path (default: "faq") categories: # FAQ categories with items - name: string # Category name order: integer # Sort order items: # Questions in category - question: string # Question text answer: string # Answer text (plain or markdown) order: integer # Sort order within category tags: [string] # Tags for search # Legal Configuration legal: enabled: boolean # Enable legal pages (default: false) path: string # Output path prefix (default: "legal") footer_group: string # Footer section title (default: "Legal") # Footer Configuration footer: copyright: string # Copyright text links: - title: string # Section title items: [{text, url}] # Links in section social: [{name, url, icon}] # Social links # Social Links (sidebar) social_links: - name: string # Display name url: string # Link URL icon: string # Icon name ``` #### Basic Settings ##### title Site title displayed in header and browser tab. ```yaml title: My Documentation ``` Type: `string` Default: `"Documentation"` ##### description Site description for SEO and metadata. ```yaml description: Comprehensive documentation for my project ``` Type: `string` Default: `""` ##### base_url Base URL for absolute links, sitemap, and canonical URLs. ```yaml base_url: https://docs.example.com ``` Type: `string` Default: `""` ##### author Default author for pages without explicit author. ```yaml author: Documentation Team ``` Type: `string` Default: `""` #### Theme Settings ##### theme Theme directory name. ```yaml theme: default ``` Type: `string` Default: `"default"` Options: `default`, `yellow`, or custom theme name ##### dark_mode Start in dark mode by default. ```yaml dark_mode: true ``` Type: `boolean` Default: `false` #### Theme Configuration Config-based theme customization without creating theme files. ##### theme_config Customize colors, fonts, and hero styling directly in config. ```yaml theme_config: name: "custom" colors: light: bg_primary: "#ffffff" link_color: "#0066cc" dark: bg_primary: "#0f172a" link_color: "#60a5fa" fonts: heading: "Inter" body: "Inter" google_url: "https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap" hero: background_image: "/images/hero-bg.jpg" background_overlay: "rgba(0,0,0,0.6)" min_height: "80vh" ``` Type: `object` Only specify fields you want to override. Unspecified fields use theme defaults. ##### theme_config.colors Override CSS color variables for light and dark modes. | Field | Description | |-------|-------------| | `bg_primary` | Main page background | | `bg_secondary` | Sidebar, cards | | `bg_tertiary` | Nested elements | | `bg_code` | Code block background | | `bg_hover` | Hover states | | `text_primary` | Main text | | `text_secondary` | Secondary text | | `text_tertiary` | Muted text | | `text_muted` | Very light text | | `border_primary` | Main borders | | `border_secondary` | Subtle borders | | `accent_primary` | Buttons, highlights | | `accent_hover` | Accent hover state | | `link_color` | Link text | | `link_hover` | Link hover | ##### theme_config.fonts Custom font configuration. | Field | Description | |-------|-------------| | `heading` | Font family for headings | | `body` | Font family for body text | | `code` | Font family for code | | `google_url` | Google Fonts import URL | ##### theme_config.hero Hero section styling. | Field | Description | |-------|-------------| | `background_image` | Background image URL | | `background_overlay` | Overlay color (e.g., `rgba(0,0,0,0.6)`) | | `text_align` | Text alignment: `left`, `center`, `right` | | `min_height` | Minimum height (e.g., `80vh`) | #### Feature Toggles ##### enable_llms Generate `llms.txt` file for AI assistants. ```yaml enable_llms: true ``` Type: `boolean` Default: `true` ##### enable_search Enable client-side search functionality. ```yaml enable_search: true ``` Type: `boolean` Default: `true` ##### clean_urls Use `/page/` instead of `/page.html` URLs. ```yaml clean_urls: true ``` Type: `boolean` Default: `false` ##### nav_depth Maximum depth for the navigation tree. Set to 0 for unlimited depth. ```yaml nav_depth: 3 ``` Type: `integer` Default: `0` (unlimited) Requires server configuration for fallback. #### OpenAPI Settings ##### openapi.enabled Enable OpenAPI documentation generation. ```yaml openapi: enabled: true ``` Type: `boolean` Default: `false` ##### openapi.spec_files Local OpenAPI specification files. ```yaml openapi: spec_files: - "api/openapi.yaml" - "api/v2/api.json" ``` Type: `array of string` Default: `[]` ##### openapi.spec_urls Remote OpenAPI specification URLs. ```yaml openapi: spec_urls: - "https://api.example.com/openapi.json" ``` Type: `array of string` Default: `[]` ##### openapi.default_view Default view mode for endpoints. ```yaml openapi: default_view: tag ``` Type: `string` Default: `"path"` Options: `path`, `tag`, `flat` ##### openapi.sync_on_build Fetch remote specs on every build. ```yaml openapi: sync_on_build: true ``` Type: `boolean` Default: `false` ##### openapi.cache_dir Directory for caching remote specs. ```yaml openapi: cache_dir: ".openapi-cache" ``` Type: `string` Default: `".openapi-cache"` ##### openapi.enable_testing Show interactive API testing interface. ```yaml openapi: enable_testing: true ``` Type: `boolean` Default: `true` ##### openapi.enable_export Enable cURL and restcli export. ```yaml openapi: enable_export: true ``` Type: `boolean` Default: `true` ##### openapi.enable_code_samples Show auto-generated code samples. ```yaml openapi: enable_code_samples: true ``` Type: `boolean` Default: `true` ##### openapi.lazy_load_chunk_size Chunk size for lazy loading large specs. ```yaml openapi: lazy_load_chunk_size: 102400 ``` Type: `integer` Default: `51200` (50KB) #### MCP Server Documentation Settings ##### mcp.enabled Enable MCP server documentation generation. ```yaml mcp: enabled: true ``` Type: `boolean` Default: `false` ##### mcp.spec_files Manifest file paths or glob patterns relative to the docs root. When empty, minimaldoc auto-discovers all `*.mcp.json` files under the docs root. ```yaml mcp: spec_files: - "mcp/*.mcp.json" ``` Type: `array of string` Default: `[]` ##### mcp.path Output URL path for generated MCP documentation. ```yaml mcp: path: "mcp" ``` Type: `string` Default: `"mcp"` #### Status Page Settings ##### status.enabled Enable status page generation. ```yaml status: enabled: true ``` Type: `boolean` Default: `false` ##### status.title Status page title. ```yaml status: title: "System Status" ``` Type: `string` Default: `"Service Status"` ##### status.description Status page description. ```yaml status: description: "Current operational status of our services" ``` Type: `string` Default: `""` ##### status.path Output path for status page. ```yaml status: path: "status" ``` Type: `string` Default: `"status"` ##### status.show_history Show incident history page. ```yaml status: show_history: true ``` Type: `boolean` Default: `true` ##### status.history_months Months of incident history to display. ```yaml status: history_months: 12 ``` Type: `integer` Default: `12` ##### status.rss_enabled Generate RSS feed for status updates. ```yaml status: rss_enabled: true ``` Type: `boolean` Default: `true` #### Changelog Settings ##### changelog.enabled Enable changelog generation. ```yaml changelog: enabled: true ``` Type: `boolean` Default: `false` ##### changelog.title Changelog page title. ```yaml changelog: title: "Release Notes" ``` Type: `string` Default: `"Changelog"` ##### changelog.path Output path for changelog. ```yaml changelog: path: "releases" ``` Type: `string` Default: `"changelog"` ##### changelog.rss_enabled Generate RSS feed for releases. ```yaml changelog: rss_enabled: true ``` Type: `boolean` Default: `true` ##### changelog.repository Repository URL for compare links. ```yaml changelog: repository: "https://github.com/org/repo" ``` Type: `string` Default: `""` #### Stale Warning Settings ##### stale_warning.enabled Enable stale content warnings. ```yaml stale_warning: enabled: true ``` Type: `boolean` Default: `true` ##### stale_warning.threshold_days Days before content is considered stale. ```yaml stale_warning: threshold_days: 365 ``` Type: `integer` Default: `365` ##### stale_warning.message Custom warning message displayed on stale pages. Leave empty to use the built-in default. ```yaml stale_warning: message: "This page may be outdated." ``` Type: `string` Default: `""` (uses built-in message) ##### stale_warning.show_update_date Show last update date in warning. ```yaml stale_warning: show_update_date: true ``` Type: `boolean` Default: `true` #### Link Check Settings ##### link_check.enabled Enable link checking during build. ```yaml link_check: enabled: true ``` Type: `boolean` Default: `true` ##### link_check.mode How to handle broken links. ```yaml link_check: mode: "error" ``` Type: `string` Default: `"warn"` Options: `error` (fail build), `warn` (continue with warnings), `ignore` (skip checking) ##### link_check.check_external Validate external URLs with HTTP requests. ```yaml link_check: check_external: true ``` Type: `boolean` Default: `false` External checking is slower and may hit rate limits. ##### link_check.external_timeout Timeout for external URL requests in seconds. ```yaml link_check: external_timeout: 10 ``` Type: `integer` Default: `5` ##### link_check.ignore_patterns URL patterns to skip during checking. ```yaml link_check: ignore_patterns: - "/api/*" - "https://example.com/*" ``` Type: `array of string` Default: `[]` Supports `*` wildcard for glob matching. ##### link_check.allowed_broken Known broken links to ignore (documentation examples, etc.). ```yaml link_check: allowed_broken: - "path.md" - "/coming-soon.html" ``` Type: `array of string` Default: `[]` #### Multi-Version Documentation Settings ##### versions.enabled Enable multi-version documentation support. ```yaml versions: enabled: true ``` Type: `boolean` Default: `false` ##### versions.default Default version to display at root URLs. ```yaml versions: default: "v2" ``` Type: `string` Default: First version in list ##### versions.list Array of version definitions. ```yaml versions: list: - name: "v2" label: "2.x (Latest)" path: "v2" - name: "v1" label: "1.x (LTS)" path: "v1" eol: "2025-12-31" ``` Type: `array of object` ##### Version Definition Fields | Field | Type | Required | Description | |-------|------|----------|-------------| | `name` | string | Yes | Version identifier | | `label` | string | No | Display label | | `path` | string | Yes | URL path prefix | | `eol` | string | No | End of life date (YYYY-MM-DD) | ##### versions.selector.position Where to show the version selector. ```yaml versions: selector: position: "header" ``` Type: `string` Default: `"header"` Options: `header`, `sidebar` ##### versions.selector.show_eol_warning Show warning banner for EOL versions. ```yaml versions: selector: show_eol_warning: true ``` Type: `boolean` Default: `true` #### Social Links ##### social_links Array of social media links. ```yaml social_links: - name: GitHub url: https://github.com/org/repo icon: github - name: Discord url: https://discord.gg/invite icon: discord ``` Type: `array of object` Default: `[]` ##### Social Link Object | Field | Type | Required | Description | |-------|------|----------|-------------| | `name` | string | Yes | Display name | | `url` | string | Yes | Link URL | | `icon` | string | Yes | Icon identifier | ##### Available Icons | Icon | Name | |------|------| | `github` | GitHub | | `twitter` | Twitter/X | | `linkedin` | LinkedIn | | `youtube` | YouTube | | `discord` | Discord | | `mastodon` | Mastodon | | `rss` | RSS Feed | | `email` | Email | | `website` | Generic Website | #### Landing Page Settings ##### landing.enabled Enable landing page generation. ```yaml landing: enabled: true ``` Type: `boolean` Default: `false` ##### landing.nav Navigation links in the landing header. ```yaml landing: nav: - text: "Docs" url: "/getting-started/installation.html" - text: "Features" url: "/features/overview.html" ``` Type: `array of object` ##### landing.hero Hero section content. ```yaml landing: hero: title: "Documentation Made Simple" subtitle: "A minimal static site generator" buttons: - text: "Get Started" url: "/getting-started/installation.html" primary: true - text: "View on GitHub" url: "https://github.com/org/repo" primary: false ``` ##### landing.features Feature grid section. ```yaml landing: features: title: "Features" items: - emoji: "~" title: "Fast" description: "Sub-second builds" - emoji: "@" title: "Dark Mode" description: "Built-in theme switching" ``` ##### landing.steps Quick start steps section. ```yaml landing: steps: title: "Quick Start" items: - title: "Install" description: "Download the binary" code: "curl -sSL https://..." - title: "Build" description: "Generate your site" code: "minimaldoc build" ``` ##### landing.links Resource links section. ```yaml landing: links: title: "Resources" items: - icon: "github" title: "GitHub" description: "Source code" url: "https://github.com/org/repo" ``` ##### landing.opensource Open source section. ```yaml landing: opensource: title: "Open Source" description: "MIT Licensed. Self-host with full control." links: - text: "GitHub Repository" url: "https://github.com/org/repo" ``` ##### landing.image_text Image + content side-by-side sections. ```yaml landing: image_text: - id: "feature" title: "Feature Title" description: "Feature description" image: "/images/feature.png" image_position: "right" order: 1 ``` Type: `array of object` | Field | Type | Description | |-------|------|-------------| | `id` | string | Section identifier | | `title` | string | Section heading | | `description` | string | Description text | | `image` | string | Image URL | | `image_alt` | string | Image alt text | | `image_position` | string | `left` or `right` | | `items` | array | Bullet points with icon, title, description | | `buttons` | array | CTA buttons | | `background` | object | Background styling | | `order` | number | Display order | ##### landing.text_blocks Simple text block sections. ```yaml landing: text_blocks: - id: "mission" title: "Our Mission" content: "

Description text

" alignment: "center" order: 2 ``` Type: `array of object` | Field | Type | Description | |-------|------|-------------| | `id` | string | Section identifier | | `title` | string | Section heading | | `subtitle` | string | Optional subtitle | | `content` | string | HTML content | | `alignment` | string | `left`, `center`, or `right` | | `max_width` | string | Max content width | | `buttons` | array | CTA buttons | | `background` | object | Background styling | | `order` | number | Display order | ##### landing.links_grid Grid of external link cards. ```yaml landing: links_grid: - id: "platforms" title: "Find Us" columns: 4 items: - icon: "github" title: "GitHub" url: "https://github.com/..." ``` Type: `array of object` | Field | Type | Description | |-------|------|-------------| | `id` | string | Section identifier | | `title` | string | Section heading | | `description` | string | Section description | | `columns` | number | Grid columns (2, 3, or 4) | | `items` | array | Link cards | | `background` | object | Background styling | | `order` | number | Display order | ##### Section Background Background styling for any landing section. ```yaml background: image: "/images/bg.jpg" overlay: "rgba(0,0,0,0.6)" color: "#1a1a2e" ``` | Field | Type | Description | |-------|------|-------------| | `image` | string | Background image URL | | `overlay` | string | Semi-transparent overlay | | `color` | string | Background color | | `position` | string | CSS background-position | | `size` | string | CSS background-size | | `attachment` | string | CSS background-attachment | #### Portfolio Settings ##### portfolio.enabled Enable portfolio page generation. ```yaml portfolio: enabled: true ``` Type: `boolean` Default: `false` ##### portfolio.title Portfolio page title. ```yaml portfolio: title: "Projects" ``` Type: `string` Default: `"Portfolio"` ##### portfolio.description Portfolio page description. ```yaml portfolio: description: "Sites built with MinimalDoc" ``` Type: `string` Default: `""` ##### portfolio.path Output path for portfolio. ```yaml portfolio: path: "projects" ``` Type: `string` Default: `"projects"` #### Contact Settings ##### contact.enabled Enable contact page generation. ```yaml contact: enabled: true ``` Type: `boolean` Default: `false` ##### contact.title Contact page title. ```yaml contact: title: "Contact Us" ``` Type: `string` Default: `"Contact"` ##### contact.description Contact page description. ```yaml contact: description: "Get in touch with our team" ``` Type: `string` Default: `""` ##### contact.path Output path for contact page. ```yaml contact: path: "contact" ``` Type: `string` Default: `"contact"` ##### contact.email Contact email address (used by form). ```yaml contact: email: "hello@example.com" ``` Type: `string` Default: `""` ##### contact.info Contact information items. ```yaml contact: info: - icon: "mail" text: "hello@example.com" - icon: "location" text: "Remote, Worldwide" - icon: "phone" text: "+1 555 123 4567" ``` Type: `array of object` ##### Contact Info Icons | Icon | Purpose | |------|---------| | `mail` | Email address | | `location` | Physical location | | `phone` | Phone number | #### FAQ Settings ##### faq.enabled Enable FAQ page generation. ```yaml faq: enabled: true ``` Type: `boolean` Default: `false` ##### faq.title FAQ page title. ```yaml faq: title: "FAQ" ``` Type: `string` Default: `"FAQ"` ##### faq.description FAQ page description. ```yaml faq: description: "Frequently asked questions" ``` Type: `string` Default: `"Frequently asked questions"` ##### faq.path Output path for FAQ page. ```yaml faq: path: "faq" ``` Type: `string` Default: `"faq"` ##### faq.categories FAQ categories with questions and answers. ```yaml faq: categories: - name: "General" order: 1 items: - question: "What is this?" answer: "A documentation generator." tags: - general - question: "Is it free?" answer: "Yes, open source under GPL-3.0." - name: "Technical" order: 2 items: - question: "What languages are supported?" answer: "100+ via Chroma syntax highlighting." ``` Type: `array of object` Categories can also be defined via markdown files in `__faq__/` directory. #### Legal Settings ##### legal.enabled Enable legal pages generation. ```yaml legal: enabled: true ``` Type: `boolean` Default: `false` ##### legal.path Output path prefix for legal pages. ```yaml legal: path: "legal" ``` Type: `string` Default: `"legal"` ##### legal.footer_group Footer section title for auto-generated legal links. ```yaml legal: footer_group: "Legal" ``` Type: `string` Default: `"Legal"` Legal pages are defined via markdown files in `__legal__/` directory. #### Footer Settings ##### footer.copyright Copyright text displayed in footer. ```yaml footer: copyright: "2025 Your Company. MIT License." ``` Type: `string` Default: `""` ##### footer.links Footer link sections. ```yaml footer: links: - title: "Documentation" items: - text: "Getting Started" url: "/getting-started/installation.html" - text: "Features" url: "/features/overview.html" - title: "Resources" items: - text: "Status" url: "/status/" - text: "GitHub" url: "https://github.com/org/repo" ``` Type: `array of object` ##### footer.social Social links in footer. ```yaml footer: social: - name: GitHub url: https://github.com/org/repo icon: github - name: Twitter url: https://twitter.com/handle icon: twitter ``` Type: `array of object` ## Changelog Format *Release file format, categories, and semver* ### Changelog Format Release files use Markdown with YAML frontmatter. #### File Structure ``` __changelog__/ └── releases/ ├── 2.0.0.md ├── 1.1.0.md ├── 1.0.0.md └── 0.1.0.md ``` Filename: `{version}.md` #### Basic Format ```markdown --- version: 1.1.0 date: 2025-01-28 --- ## Added - New authentication system - Dark mode support - Export to PDF feature ## Changed - Improved search performance - Updated dependencies ## Fixed - Fixed login timeout issue - Corrected date formatting ``` #### Frontmatter Fields | Field | Type | Required | Description | |-------|------|----------|-------------| | `version` | string | Yes | Semver version | | `date` | string | Yes | Release date (YYYY-MM-DD) | | `title` | string | No | Release title | | `prerelease` | bool | No | Mark as prerelease | #### Categories Standard categories from Keep a Changelog: | Category | Description | Badge Color | |----------|-------------|-------------| | `Added` | New features | Green | | `Changed` | Changes in existing functionality | Blue | | `Deprecated` | Features to be removed | Yellow | | `Removed` | Removed features | Red | | `Fixed` | Bug fixes | Purple | | `Security` | Security fixes | Orange | ##### Category Headings Use H2 headings: ```markdown ## Added - Feature one - Feature two ## Fixed - Bug fix one ``` ##### Entry Format Use list items: ```markdown ## Added - Brief description of feature - Another feature with more detail that explains what changed and why - Feature with [link to issue](https://github.com/org/repo/issues/123) ``` #### Semver Versions follow [Semantic Versioning](https://semver.org): ``` MAJOR.MINOR.PATCH ``` | Component | When to Increment | |-----------|-------------------| | MAJOR | Breaking changes | | MINOR | New features (backward compatible) | | PATCH | Bug fixes (backward compatible) | ##### Examples ``` 1.0.0 # Initial release 1.0.1 # Bug fix 1.1.0 # New feature 2.0.0 # Breaking change ``` ##### Prereleases ``` 2.0.0-alpha.1 2.0.0-beta.1 2.0.0-rc.1 ``` Mark in frontmatter: ```yaml --- version: 2.0.0-beta.1 date: 2025-01-20 prerelease: true --- ``` #### Sorting Releases sorted by semver: ``` 2.0.0 # First (newest) 1.1.0 1.0.1 1.0.0 0.2.0 0.1.0 # Last (oldest) ``` Prereleases sort before their release: ``` 2.0.0 2.0.0-rc.1 2.0.0-beta.1 2.0.0-alpha.1 1.0.0 ``` #### Examples ##### Initial Release ```markdown --- version: 1.0.0 date: 2025-01-15 title: Initial Release --- ## Added - Core documentation features - Markdown support with GFM - Automatic navigation - Dark mode support - Search functionality - Syntax highlighting ``` ##### Feature Release ```markdown --- version: 1.1.0 date: 2025-01-28 --- ## Added - OpenAPI/Swagger documentation support - Status page feature - Social links in sidebar ## Changed - Improved search performance - Updated navigation styling ## Fixed - Fixed mobile menu toggle - Corrected sitemap generation ``` ##### Bug Fix Release ```markdown --- version: 1.0.1 date: 2025-01-20 --- ## Fixed - Fixed syntax highlighting for YAML - Corrected link handling in TOC - Fixed dark mode persistence ``` ##### Breaking Change ```markdown --- version: 2.0.0 date: 2025-02-15 title: Configuration Overhaul --- ## Changed - **BREAKING**: Renamed `config.yml` to `config.yaml` - **BREAKING**: Changed theme structure ## Added - New configuration options - Plugin system ## Removed - **BREAKING**: Removed legacy theme format ## Migration See [migration guide](/docs/migration-v2.html) for upgrade instructions. ``` ##### Security Release ```markdown --- version: 1.0.2 date: 2025-01-22 --- ## Security - Fixed XSS vulnerability in search input - Updated dependencies with security patches ## Fixed - Minor UI fixes ``` ##### Prerelease ```markdown --- version: 2.0.0-beta.1 date: 2025-02-01 prerelease: true --- ## Added - Preview of new plugin system - Experimental features ## Changed - Updated internal architecture ## Known Issues - Plugin hot-reload not working - Some themes may not render correctly ``` #### Compare Links With repository configured: ```yaml changelog: repository: "https://github.com/org/repo" ``` Links generated: | Version | Compare Link | |---------|--------------| | 2.0.0 | `/compare/v1.1.0...v2.0.0` | | 1.1.0 | `/compare/v1.0.0...v1.1.0` | | 1.0.0 | `/releases/tag/v1.0.0` | Assumes tags follow `v{version}` format. ## Markdown Syntax *Supported Markdown syntax and GitHub Flavored Markdown extensions* ### Markdown Syntax MinimalDoc supports standard Markdown plus GitHub Flavored Markdown (GFM) extensions. #### Headings ```markdown # Heading 1 ## Heading 2 ### Heading 3 #### Heading 4 ##### Heading 5 ###### Heading 6 ``` Headings generate anchor IDs automatically: - `## Getting Started` → `#getting-started` - `### API Reference` → `#api-reference` #### Text Formatting ```markdown **Bold text** *Italic text* ***Bold and italic*** ~~Strikethrough~~ `Inline code` ``` **Bold text**, *Italic text*, ***Bold and italic***, ~~Strikethrough~~, `Inline code` #### Links ```markdown [Internal link](../guides/deployment.md) [Anchor link](#headings) [External link](https://example.com) ``` External links automatically open in new tabs with `target="_blank"`. #### Images ```markdown ![Alt text](/images/screenshot.png) ![Alt text](/images/photo.jpg "Optional title") ``` #### Lists ##### Unordered ```markdown - Item one - Item two - Nested item - Another nested - Item three ``` - Item one - Item two - Nested item - Another nested - Item three ##### Ordered ```markdown 1. First item 2. Second item 1. Nested first 2. Nested second 3. Third item ``` 1. First item 2. Second item 1. Nested first 2. Nested second 3. Third item ##### Task Lists ```markdown - [x] Completed task - [ ] Incomplete task - [ ] Another task ``` - [x] Completed task - [ ] Incomplete task - [ ] Another task #### Blockquotes ```markdown > Single line quote > Multi-line quote > continues here > > > Nested quote ``` > Single line quote > Multi-line quote > continues here > > > Nested quote #### Code ##### Inline ```markdown Use `config.yaml` for configuration. ``` Use `config.yaml` for configuration. ##### Blocks ````markdown ```go package main func main() { fmt.Println("Hello") } ``` ```` ```go package main func main() { fmt.Println("Hello") } ``` Supported languages include: go, javascript, typescript, python, bash, yaml, json, html, css, sql, rust, swift, and 100+ more via Chroma. #### Tables ```markdown | Header 1 | Header 2 | Header 3 | |----------|:--------:|---------:| | Left | Center | Right | | Data | Data | Data | ``` | Header 1 | Header 2 | Header 3 | |----------|:--------:|---------:| | Left | Center | Right | | Data | Data | Data | Column alignment: - `:---` Left (default) - `:---:` Center - `---:` Right #### Horizontal Rule ```markdown --- ``` --- #### HTML Raw HTML is supported: ```html
Click to expand Hidden content here.
```
Click to expand Hidden content here.
#### Escaping Use backslash to escape special characters: ```markdown \*not italic\* \# not a heading \[not a link\] ``` \*not italic\*, \# not a heading, \[not a link\] #### Line Breaks Two trailing spaces create a line break: ```markdown Line one Line two ``` Or use `
`: ```markdown Line one
Line two ``` ## Search *Client-side full-text search with keyboard shortcuts* ### Search MinimalDoc includes client-side full-text search with fuzzy matching. #### Usage ##### Keyboard Shortcut Press `Cmd+K` (macOS) or `Ctrl+K` (Windows/Linux) to open search. ##### Click Click the search input in the sidebar. ##### Navigation | Key | Action | |-----|--------| | `↑` / `↓` | Navigate results | | `Enter` | Go to selected result | | `Escape` | Close search | #### Search Index A `search-index.json` file is generated during build: ```json [ { "title": "Installation", "description": "How to install MinimalDoc", "url": "/getting-started/installation.html", "tags": ["getting-started", "installation"], "content": "First 500 characters of content..." } ] ``` ##### Indexed Fields | Field | Weight | Source | |-------|--------|--------| | Title | Highest | Frontmatter `title` | | Description | High | Frontmatter `description` | | Tags | Medium | Frontmatter `tags` | | Content | Lower | Page body (first 500 chars) | #### Configuration Search is enabled by default: ```yaml # config.yaml enable_search: true ``` Disable search: ```yaml enable_search: false ``` #### Fuzzy Matching Search tolerates typos and partial matches: | Query | Matches | |-------|---------| | `instal` | "Installation" | | `confg` | "Configuration" | | `api ref` | "API Reference" | #### Index Size Typical index sizes: | Pages | Index Size | |-------|------------| | 10 | ~5 KB | | 50 | ~25 KB | | 100 | ~50 KB | | 500 | ~250 KB | #### Optimization Tips ##### Good Titles ```yaml # Good - Specific, searchable title: Configure OAuth 2.0 Authentication # Avoid - Generic, hard to find title: Configuration ``` ##### Descriptive Tags ```yaml tags: - authentication - oauth - security - api ``` ##### Front-Load Content Put important keywords in the first 500 characters, as that's what gets indexed. ##### Unique Descriptions ```yaml # Good - Unique, descriptive description: Set up OAuth 2.0 authentication with Google, GitHub, or custom providers # Avoid - Generic description: Authentication documentation ``` #### Excluding Pages Hidden pages are excluded from search: ```yaml --- title: Internal Notes hidden: true --- ``` #### Search UI The search interface includes: - Search input with placeholder - Real-time results as you type - Result highlighting - Keyboard navigation indicators - Result count - "No results" state #### Technical Details ##### Algorithm 1. Tokenize query into words 2. For each word, find fuzzy matches in index 3. Score matches by field weight and match quality 4. Sort by combined score 5. Return top N results ##### Performance - Index loaded once, cached in memory - Search executes in <10ms for most sites - No server round-trips ## Quick Start *Create your first MinimalDoc site in minutes* ### Quick Start #### Initialize a New Site ```bash minimaldoc init my-docs cd my-docs ``` Generated structure: ``` my-docs/ ├── config.yaml ├── index.md ├── getting-started/ │ ├── installation.md │ └── quick-start.md └── guides/ └── deployment.md ``` For a full-featured site with status page, changelog, and OpenAPI: ```bash minimaldoc init my-docs --full ``` This adds: ``` my-docs/ ├── config.yaml # All config here ├── TOC.md # Custom navigation ├── api/openapi.yaml # OpenAPI spec ├── __status__/ # Status page │ ├── components.yaml │ └── incidents/ └── __changelog__/ # Changelog └── releases/ ``` #### Build the Site ```bash minimaldoc build my-docs ``` Output written to `public/`: ``` public/ ├── index.html ├── getting-started/ │ ├── installation.html │ └── quick-start.html ├── guides/ │ └── deployment.html ├── search-index.json ├── sitemap.xml └── llms.txt ``` #### Preview Open `public/index.html` in your browser, or serve locally: ```bash # Python python -m http.server -d public 8080 # Go go run github.com/nicholaswilde/go-serve@latest -d public # Node npx serve public ``` Visit `http://localhost:8080`. #### Add a Page Create `my-docs/guides/getting-help.md`: ```markdown --- title: Getting Help description: Where to find help and support --- # Getting Help Visit our [GitHub Issues](https://github.com/studiowebux/minimaldoc/issues). ``` Rebuild: ```bash minimaldoc build ``` The page appears in navigation automatically. #### Edit Configuration The `config.yaml` file is created automatically. Edit it to customize your site: ```yaml title: My Project Docs description: Documentation for my project base_url: https://docs.myproject.com theme: default # Enable optional features enable_llms: true enable_search: true # Uncomment to enable OpenAPI docs # openapi: # enabled: true # spec_files: # - "api/openapi.yaml" # Uncomment to enable status page # status: # enabled: true ``` Rebuild to apply changes. #### Next Steps - [Configuration](03-configuration.md) - Full configuration reference - [Project Structure](../core-concepts/01-project-structure.md) - Understand the file layout - [Navigation](../core-concepts/04-navigation.md) - Customize navigation ## GitHub Pages *Deploy documentation to GitHub Pages* ### GitHub Pages Deploy MinimalDoc to GitHub Pages with automated builds. #### Repository Setup ##### Option 1: Docs in Main Repo ``` my-project/ ├── src/ ├── docs/ # Documentation source ├── README.md └── .github/ └── workflows/ └── docs.yml ``` ##### Option 2: Dedicated Docs Repo ``` my-project-docs/ ├── docs/ # Documentation source └── .github/ └── workflows/ └── docs.yml ``` #### GitHub Actions Workflow Create `.github/workflows/docs.yml`: ```yaml name: Deploy Documentation on: push: branches: [main] paths: - 'docs/**' - '.github/workflows/docs.yml' workflow_dispatch: permissions: contents: read pages: write id-token: write concurrency: group: pages cancel-in-progress: true jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Setup Go uses: actions/setup-go@v5 with: go-version: '1.24' - name: Install MinimalDoc run: go install github.com/studiowebux/minimaldoc/cmd/minimaldoc@latest - name: Build Documentation run: | minimaldoc build ./docs \ --base-url "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}" \ --output dist - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: path: dist deploy: needs: build runs-on: ubuntu-latest environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 ``` #### Enable GitHub Pages 1. Go to repository Settings 2. Navigate to Pages 3. Source: GitHub Actions #### Custom Domain ##### Configure Domain 1. Add `CNAME` file to docs output: ```yaml - name: Build Documentation run: | minimaldoc build ./docs --output dist echo "docs.example.com" > dist/CNAME ``` 2. Or add CNAME in docs folder (gets copied): ``` docs/ ├── CNAME # Contains: docs.example.com ├── config.yaml └── index.md ``` ##### DNS Configuration See [GitHub's official DNS documentation](https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site) for current IP addresses and configuration. ##### Update Base URL ```yaml # config.yaml base_url: https://docs.example.com ``` #### Clean URLs For clean URLs on GitHub Pages: ```yaml clean_urls: true ``` Add 404 handling in workflow: ```yaml - name: Build Documentation run: | minimaldoc build ./docs --output dist --clean-urls cp dist/index.html dist/404.html ``` #### Organization Sites For `username.github.io` repository: ```yaml - name: Build Documentation run: | minimaldoc build ./docs \ --base-url "https://username.github.io" \ --output dist ``` #### Project Sites For `username.github.io/project-name`: ```yaml - name: Build Documentation run: | minimaldoc build ./docs \ --base-url "https://username.github.io/project-name" \ --output dist ``` #### Multiple Documentation Sites ##### Monorepo ```yaml jobs: build-docs: runs-on: ubuntu-latest strategy: matrix: project: [api, sdk, cli] steps: - uses: actions/checkout@v4 - name: Build ${{ matrix.project }} run: | minimaldoc build ./packages/${{ matrix.project }}/docs \ --output dist/${{ matrix.project }} ``` #### Caching Speed up builds with caching: ```yaml - name: Setup Go uses: actions/setup-go@v5 with: go-version: '1.24' cache: true - name: Cache MinimalDoc uses: actions/cache@v4 with: path: ~/go/bin/minimaldoc key: minimaldoc-${{ runner.os }} ``` #### Branch Protection Protect main branch: 1. Settings > Branches > Add rule 2. Require status checks 3. Add "build" as required check #### Manual Deployment Deploy on-demand: ```yaml on: workflow_dispatch: inputs: environment: description: 'Deployment environment' required: true default: 'production' type: choice options: - production - staging ``` ## OpenAPI Configuration *Configure OpenAPI documentation generation* ### OpenAPI Configuration #### Basic Configuration ```yaml # config.yaml openapi: enabled: true spec_files: - "api/openapi.yaml" ``` #### Full Configuration ```yaml openapi: enabled: true # Local spec files (relative to docs root) spec_files: - "api/openapi.yaml" - "api/v2/api.json" # Remote specs spec_urls: - "https://api.example.com/openapi.json" # View mode: path, tag, flat default_view: "path" # Remote spec options sync_on_build: false cache_dir: ".openapi-cache" # Features enable_testing: true enable_export: true enable_code_samples: true # Performance lazy_load_chunk_size: 51200 ``` #### Configuration Reference ##### Core Settings | Option | Type | Default | Description | |--------|------|---------|-------------| | `enabled` | bool | `false` | Enable OpenAPI documentation | | `spec_files` | []string | `[]` | Local spec file paths | | `spec_urls` | []string | `[]` | Remote spec URLs | | `default_view` | string | `"path"` | Default view mode | ##### Remote Spec Settings | Option | Type | Default | Description | |--------|------|---------|-------------| | `sync_on_build` | bool | `false` | Fetch remote specs on build | | `cache_dir` | string | `".openapi-cache"` | Cache directory for remote specs | ##### Feature Toggles | Option | Type | Default | Description | |--------|------|---------|-------------| | `enable_testing` | bool | `true` | Show "Try It" interface | | `enable_export` | bool | `true` | Enable cURL/restcli export | | `enable_code_samples` | bool | `true` | Show code sample panel | ##### Performance | Option | Type | Default | Description | |--------|------|---------|-------------| | `lazy_load_chunk_size` | int | `51200` | Chunk size for lazy loading (bytes) | #### CLI Flags Override config via CLI: ```bash minimaldoc build \ --openapi \ --openapi-dir api ``` | Flag | Description | |------|-------------| | `--openapi` | Enable OpenAPI (shorthand) | | `--openapi-dir` | Directory containing specs | #### Spec File Location ##### Default Place specs in `api/` directory: ``` docs/ └── api/ ├── openapi.yaml └── v2.yaml ``` ##### Custom Directory ```yaml openapi: spec_files: - "specs/main.yaml" - "specs/admin.yaml" ``` Or via CLI: ```bash minimaldoc build --openapi --openapi-dir specs ``` #### Multiple Specs Each spec generates separate documentation: ```yaml openapi: enabled: true spec_files: - "api/public.yaml" # /api/public/ - "api/admin.yaml" # /api/admin/ - "api/internal.yaml" # /api/internal/ ``` #### Remote Specs Fetch specs from URLs during build: ```yaml openapi: enabled: true spec_urls: - "https://api.service1.com/openapi.json" - "https://api.service2.com/openapi.yaml" sync_on_build: true cache_dir: ".openapi-cache" ``` ##### Caching - Specs cached locally to avoid repeated fetches - Cache directory can be gitignored - Clear cache to force refresh ```bash rm -rf .openapi-cache minimaldoc build --openapi ``` #### View Modes Set default view: ```yaml openapi: default_view: "path" # path | tag | flat ``` | Mode | Description | |------|-------------| | `path` | Group by URL path | | `tag` | Group by OpenAPI tags | | `flat` | Flat list, no grouping | Users can switch views in the UI. #### Feature Configuration ##### Disable Testing For read-only documentation: ```yaml openapi: enable_testing: false ``` ##### Disable Export Hide cURL/restcli export: ```yaml openapi: enable_export: false ``` ##### Disable Code Samples Hide code sample panel: ```yaml openapi: enable_code_samples: false ``` #### Examples ##### Minimal Setup ```yaml openapi: enabled: true spec_files: - "api/openapi.yaml" ``` ##### Read-Only Documentation ```yaml openapi: enabled: true spec_files: - "api/openapi.yaml" enable_testing: false enable_export: false ``` ##### Multiple Remote APIs ```yaml openapi: enabled: true spec_urls: - "https://api.prod.example.com/openapi.json" - "https://api.staging.example.com/openapi.json" sync_on_build: true cache_dir: ".openapi-cache" default_view: "tag" ``` ##### High-Performance ```yaml openapi: enabled: true spec_files: - "api/large-api.yaml" lazy_load_chunk_size: 102400 # 100KB chunks ``` ## Components *Define and configure service components* ### Components Components represent services displayed on your status page. #### Basic Configuration Create `__status__/components.yaml`: ```yaml - id: api name: API status: operational - id: web name: Web Application status: operational - id: database name: Database status: operational ``` #### Full Configuration ```yaml - id: api name: API description: Core REST API status: operational group: Core Services order: 1 url: https://api.example.com health_endpoint: /health health_interval: 30 uptime: mode: incidents sla_target: 99.9 period_days: 90 ``` #### Field Reference | Field | Type | Required | Description | | ----------------- | ------ | -------- | --------------------------------------- | | `id` | string | Yes | Unique identifier | | `name` | string | Yes | Display name | | `description` | string | No | Component description | | `status` | string | No | Current status (default: `operational`) | | `group` | string | No | Group for organization | | `order` | int | No | Sort order within group | | `url` | string | No | Service URL | | `health_endpoint` | string | No | Health check path | | `health_interval` | int | No | Check interval (seconds) | | `uptime` | object | No | Uptime tracking config | #### Status Values | Status | Display | | ---------------- | --------------- | | `operational` | Green checkmark | | `degraded` | Yellow warning | | `partial_outage` | Orange alert | | `major_outage` | Red X | | `maintenance` | Blue wrench | #### Grouping Organize components into groups: ```yaml - id: api name: API group: Core Services order: 1 - id: web name: Web App group: Core Services order: 2 - id: cdn name: CDN group: Infrastructure order: 1 - id: storage name: Storage group: Infrastructure order: 2 ``` Renders as: ``` Core Services ├── API ✓ └── Web App ✓ Infrastructure ├── CDN ✓ └── Storage ✓ ``` #### Ordering Components sorted by: 1. Group name (alphabetical) 2. `order` field (ascending) 3. Component name (alphabetical) ```yaml # Explicit ordering - id: api name: API group: Core order: 1 # First - id: web name: Web group: Core order: 2 # Second - id: admin name: Admin group: Core order: 3 # Third ``` #### Health Checks Configure browser-based health polling: ```yaml - id: api name: API url: https://api.example.com health_endpoint: /health health_interval: 30 ``` | Field | Description | | ----------------- | ----------------------- | | `url` | Base URL of service | | `health_endpoint` | Path to health endpoint | | `health_interval` | Seconds between checks | The status page polls endpoints and shows: - Current status indicator - Response latency - Last check time See [Health Checks](06-health-checks.md) for details. #### Uptime Configuration Track uptime per component: ```yaml - id: api name: API uptime: mode: incidents # or "api" sla_target: 99.9 period_days: 90 ``` | Field | Description | | ------------- | --------------------------------- | | `mode` | Data source: `incidents` or `api` | | `sla_target` | Target uptime percentage | | `period_days` | Tracking period | See [Uptime Tracking](05-uptime-tracking.md) for details. #### Examples ##### Minimal ```yaml - id: website name: Website ``` ##### Basic Service ```yaml - id: api name: REST API description: Public API endpoints status: operational group: Backend ``` ##### With Health Check ```yaml - id: api name: API status: operational url: https://api.example.com health_endpoint: /health health_interval: 30 ``` ##### With Uptime Tracking ```yaml - id: api name: API status: operational uptime: mode: incidents sla_target: 99.9 period_days: 90 ``` ##### Full Configuration ```yaml - id: api name: REST API description: Core API for all client applications status: operational group: Core Services order: 1 url: https://api.example.com health_endpoint: /health health_interval: 30 uptime: mode: incidents sla_target: 99.9 period_days: 90 ``` #### Complete Example ```yaml # __status__/components.yaml # Core Services - id: api name: API description: REST API status: operational group: Core Services order: 1 url: https://api.example.com health_endpoint: /health health_interval: 30 uptime: mode: incidents sla_target: 99.9 - id: web name: Web Application description: Main web interface status: operational group: Core Services order: 2 url: https://app.example.com health_endpoint: /health health_interval: 30 - id: mobile-api name: Mobile API description: API for mobile apps status: operational group: Core Services order: 3 # Infrastructure - id: database name: Database description: PostgreSQL cluster status: operational group: Infrastructure order: 1 uptime: mode: incidents sla_target: 99.99 - id: cdn name: CDN description: Content delivery network status: operational group: Infrastructure order: 2 - id: storage name: Object Storage description: S3-compatible storage status: operational group: Infrastructure order: 3 ``` ## Templates *Starter templates for documentation content* ### Templates Starter templates for common documentation patterns. #### Available Templates | Template | Description | Location | |----------|-------------|----------| | `config.yaml` | Site configuration | `docs/config.yaml` | | `page.md` | Documentation page | `docs/*.md` | | `toc.md` | Custom navigation | `docs/TOC.md` | | `portfolio-item.md` | Portfolio project | `docs/__portfolio__/*.md` | | `faq-item.md` | FAQ question/answer | `docs/__faq__/category/*.md` | | `kb-article.md` | Knowledge base article | `docs/__kb__/category/*.md` | | `legal-page.md` | Legal page | `docs/__legal__/*.md` | | `openapi-page.md` | OpenAPI endpoint page | `docs/api/*.md` | | `version-page.md` | Versioned documentation | `docs/__versions__/v*/*.md` | | `changelog-release.md` | Individual release | `docs/__changelog__/releases/*.md` | | `components.yaml` | Status components | `docs/__status__/components.yaml` | | `incident.md` | Incident report | `docs/__status__/incidents/*.md` | | `maintenance.md` | Maintenance notice | `docs/__status__/maintenance/*.md` | #### Page Template ```markdown --- title: Page Title description: Brief description for SEO and search tags: - tag1 - tag2 author: Author Name --- # Page Title Introduction paragraph explaining the page content. ## Section One Content for section one. ### Subsection More detailed content. ## Section Two Content for section two. ## Next Steps - [Related Page](related.md) - [Another Page](another.md) ``` #### TOC.md Template ```markdown # My Documentation - [GitHub](https://github.com/org/repo) - [Home](index.md) - Getting Started - [Installation](getting-started/installation.md) - [Quick Start](getting-started/quick-start.md) - [Configuration](getting-started/configuration.md) - Features - [Overview](features/overview.md) - [Feature A](features/feature-a.md) - [Feature B](features/feature-b.md) - Guides - [Deployment](guides/deployment.md) - [Customization](guides/customization.md) - API Reference - [REST API](api/rest.md) - [SDK](api/sdk.md) - Resources - [GitHub](https://github.com/org/repo) - [Support](https://support.example.com) ``` #### config.yaml Template ```yaml # Site Information title: My Documentation description: Documentation for my project base_url: https://docs.example.com author: Documentation Team # Theme theme: default dark_mode: false # Features enable_llms: true enable_search: true clean_urls: false # OpenAPI (optional) openapi: enabled: false spec_files: - "api/openapi.yaml" spec_urls: [] default_view: "path" enable_testing: true enable_code_samples: true # Status Page (optional) status: enabled: false title: "Service Status" path: "status" show_history: true rss_enabled: true # Changelog (optional) changelog: enabled: false title: "Changelog" path: "changelog" repository: "https://github.com/org/repo" # Stale Warning stale_warning: enabled: true threshold_days: 365 show_update_date: true # Landing Page (optional) landing: enabled: false nav: - text: "Docs" url: "/getting-started/installation.html" hero: title: "Documentation Made Simple" subtitle: "A minimal static site generator" buttons: - text: "Get Started" url: "/getting-started/installation.html" primary: true features: title: "Features" items: - emoji: "~" title: "Fast" description: "Sub-second builds" # Portfolio (optional) portfolio: enabled: false title: "Projects" description: "Showcase of projects" path: "projects" # Contact (optional) contact: enabled: false title: "Contact" description: "Get in touch" path: "contact" email: "hello@example.com" info: - icon: "mail" text: "hello@example.com" - icon: "location" text: "Remote" # Footer footer: copyright: "2025 Your Company" links: - title: "Documentation" items: - text: "Getting Started" url: "/getting-started/installation.html" social: - name: GitHub url: https://github.com/org/repo icon: github # Social Links (sidebar) social_links: - name: GitHub url: https://github.com/org/repo icon: github ``` #### Status Components Template ```yaml # docs/__status__/components.yaml # Core Services - id: api name: API description: Core REST API status: operational group: Core Services order: 1 url: https://api.example.com health_endpoint: /health health_interval: 30 uptime: mode: incidents sla_target: 99.9 period_days: 90 - id: web name: Web Application description: Main web interface status: operational group: Core Services order: 2 url: https://app.example.com health_endpoint: /health health_interval: 30 # Infrastructure - id: database name: Database description: PostgreSQL cluster status: operational group: Infrastructure order: 1 uptime: mode: incidents sla_target: 99.99 - id: cache name: Cache description: Redis cache cluster status: operational group: Infrastructure order: 2 ``` #### Incident Template ```markdown --- title: Brief Description of Issue status: investigating severity: minor affected_components: - api - web created_at: 2025-01-28T10:00:00Z --- ## Update - 10:00 UTC Initial report of the issue. We are investigating. Describe what is known so far. ``` ##### Incident Status Values | Status | When to Use | |--------|-------------| | `investigating` | Initial investigation | | `identified` | Root cause found | | `monitoring` | Fix applied, monitoring | | `resolved` | Fully resolved | ##### Incident Severity Values | Severity | Description | |----------|-------------| | `minor` | Low impact | | `major` | Significant impact | | `critical` | Service down | #### Maintenance Template ```markdown --- title: Maintenance Title description: Brief description of maintenance affected_components: - database - api scheduled_start: 2025-02-01T02:00:00Z scheduled_end: 2025-02-01T04:00:00Z status: scheduled --- Description of the maintenance and its purpose. ## Expected Impact - Service A will be unavailable - Service B will have reduced performance - Expected duration: 2 hours ## Preparation Instructions for users, if any. ``` ##### Maintenance Status Values | Status | When to Use | |--------|-------------| | `scheduled` | Planned, not started | | `in_progress` | Currently underway | | `completed` | Finished | #### Portfolio Project Template ```markdown --- title: Project Name description: Brief project description tags: - web - documentation image: /images/project-screenshot.png links: - text: Live Demo url: https://example.com - text: Source Code url: https://github.com/user/project date: 2025-01-15 featured: true order: 1 --- Project description with details about the implementation, technologies used, and outcomes achieved. ``` ##### Portfolio Fields | Field | Type | Required | Description | |-------|------|----------|-------------| | `title` | string | Yes | Project name | | `description` | string | No | Brief description | | `image` | string | No | Thumbnail image URL or path | | `tags` | array | No | Filterable tags | | `links` | array | No | Array of `{text, url}` objects | | `date` | string | No | Project date (ISO 8601) | | `featured` | boolean | No | Show in featured section | | `order` | integer | No | Display order | #### FAQ Item Template ```markdown --- question: How do I configure the site? category: Getting Started order: 1 tags: - configuration --- Edit `config.yaml` in your docs directory. ``` ##### FAQ Fields | Field | Type | Required | Description | |-------|------|----------|-------------| | `question` | string | Yes | The FAQ question text | | `category` | string | Yes | Category name for grouping | | `order` | integer | No | Sort order within category | | `tags` | array | No | Tags for search | #### Knowledge Base Article Template ```markdown --- title: Article Title description: Brief summary of what this article covers tags: - troubleshooting - setup order: 1 --- ## Problem Describe the problem or topic. ## Solution Step-by-step solution or explanation. ``` ##### Knowledge Base Fields | Field | Type | Required | Description | |-------|------|----------|-------------| | `title` | string | Yes | Article title | | `description` | string | No | Summary shown in article cards | | `tags` | array | No | Tags for search and related articles | | `order` | integer | No | Sort order within category | Category is determined by the directory name under `__kb__/`. #### Legal Page Template ```markdown --- title: Privacy Policy description: How we handle your data order: 1 --- **Effective date:** YYYY-MM-DD ## Information We Collect Describe what data is collected. ``` ##### Legal Fields | Field | Type | Required | Description | |-------|------|----------|-------------| | `title` | string | Yes | Page title | | `description` | string | No | Brief description | | `order` | integer | No | Sort order in footer links | #### OpenAPI Endpoint Page Template ```markdown --- title: Create User description: API endpoint for creating a new user openapi_spec: api/openapi.yaml openapi_path: /users openapi_method: POST --- Additional context or usage notes for this endpoint. ``` ##### OpenAPI Fields | Field | Type | Required | Description | |-------|------|----------|-------------| | `openapi_spec` | string | Yes | Path to OpenAPI spec file or URL | | `openapi_path` | string | Yes | API endpoint path (e.g., `/users`) | | `openapi_method` | string | Yes | HTTP method (`GET`, `POST`, etc.) | Without `openapi_path` and `openapi_method`, the page embeds the full spec. #### Versioned Page Template ```markdown --- title: Feature Name description: Feature available since v2.0 versions: - v2 - v3 since: "v2.0" # deprecated_in: "v3.0" # removed_in: "v4.0" # version_note: Important version-specific information --- Feature documentation content. ``` ##### Version Fields | Field | Type | Required | Description | |-------|------|----------|-------------| | `versions` | array | No | Versions this page appears in (empty = all) | | `since` | string | No | Version where feature was introduced | | `deprecated_in` | string | No | Version where feature was deprecated | | `removed_in` | string | No | Version where feature was removed | | `version_note` | string | No | Note displayed for version context | #### Changelog Release Template ```markdown --- version: 1.0.0 date: 2025-01-28 title: Optional Release Title --- ## Added - New feature A - New feature B ## Changed - Updated feature C - Improved performance of D ## Fixed - Fixed bug in E - Corrected behavior of F ## Security - Patched vulnerability in G ``` ##### Changelog Categories | Category | Description | Color | |----------|-------------|-------| | `Added` | New features | Green | | `Changed` | Changes to existing features | Blue | | `Deprecated` | Features to be removed | Yellow | | `Removed` | Removed features | Red | | `Fixed` | Bug fixes | Purple | | `Security` | Security fixes | Orange | #### Directory Structure Complete documentation structure: ``` docs/ ├── config.yaml # All configuration ├── TOC.md # Custom navigation (optional) ├── index.md # Homepage ├── getting-started/ │ └── *.md ├── features/ │ └── *.md ├── api/ │ ├── openapi.yaml # OpenAPI specs (if enabled) │ └── endpoint.md # Per-endpoint pages (optional) ├── __portfolio__/ # Portfolio (if enabled) │ └── project-name.md ├── __faq__/ # FAQ (if enabled) │ └── category-name/ │ └── question.md ├── __kb__/ # Knowledge base (if enabled) │ └── category-name/ │ └── article.md ├── __legal__/ # Legal pages (if enabled) │ └── privacy-policy.md ├── __changelog__/ # Per-release changelog (if enabled) │ └── releases/ │ └── vX.Y.Z.md ├── __versions__/ # Versioned docs (if enabled) │ ├── v1/ │ │ └── *.md │ └── v2/ │ └── *.md └── __status__/ # Status page (if enabled) ├── components.yaml ├── incidents/ │ └── YYYY-MM-DD-*.md └── maintenance/ └── YYYY-MM-DD-*.md ``` ## Frontmatter *YAML frontmatter schema for page metadata and configuration* ### Frontmatter YAML frontmatter at the top of Markdown files defines page metadata. #### Basic Format ```yaml --- title: Page Title description: Brief description for SEO --- # Page Content Markdown content here... ``` #### Full Schema ```yaml --- # Required title: Page Title # Recommended description: Brief page description for SEO and search tags: - tag1 - tag2 # Optional metadata author: Author Name date: 2025-01-15 # Navigation menu_title: Short Title # Override title in navigation menu_order: 10 # Sort order (lower = earlier) hidden: false # Hide from navigation # Layout overrides full_width: false # Full-width layout (no sidebar) no_header: false # Hide page header # Stale warning stale_warning: true # Override site setting stale_threshold_days: 730 # Override threshold for this page # OpenAPI integration openapi_spec: petstore.yaml # Embed API endpoint in this page openapi_path: /pets openapi_method: GET # SEO overrides seo: title: SEO Title Override description: SEO description override keywords: - keyword1 - keyword2 image: /images/og-image.png canonical: https://example.com/canonical-url noindex: false nofollow: false --- ``` #### Field Reference ##### Core Fields | Field | Type | Required | Description | |-------|------|----------|-------------| | `title` | string | Yes | Page title, used in navigation and `` | | `description` | string | No | Page description for SEO and search results | | `tags` | []string | No | Tags for categorization and search | | `author` | string | No | Page author | | `date` | string | No | Publication date (ISO 8601) | ##### Navigation Fields | Field | Type | Default | Description | |-------|------|---------|-------------| | `menu_title` | string | `title` | Shorter title for navigation | | `menu_order` | int | 0 | Sort order within section | | `hidden` | bool | false | Hide from navigation | ##### Stale Warning Fields | Field | Type | Default | Description | |-------|------|---------|-------------| | `stale_warning` | bool | site default | Enable/disable stale warning | | `stale_threshold_days` | int | site default | Days before considered stale | ##### SEO Fields | Field | Type | Description | |-------|------|-------------| | `seo.title` | string | Override `<title>` tag | | `seo.description` | string | Override meta description | | `seo.keywords` | []string | Meta keywords | | `seo.image` | string | Open Graph image URL | | `seo.canonical` | string | Canonical URL | | `seo.noindex` | bool | Add noindex meta | | `seo.nofollow` | bool | Add nofollow meta | ##### Layout Fields Control page layout and chrome visibility. | Field | Type | Default | Description | |-------|------|---------|-------------| | `full_width` | bool | false | Hide sidebar, use full-width layout | | `no_header` | bool | false | Hide page header (title, description, buttons) | ##### OpenAPI Integration Fields Embed OpenAPI endpoint documentation in a markdown page. | Field | Type | Description | |-------|------|-------------| | `openapi_spec` | string | Reference to OpenAPI spec file or URL | | `openapi_path` | string | Specific API endpoint path to embed (e.g., `/pets`) | | `openapi_method` | string | HTTP method to embed (e.g., `GET`, `POST`) | ##### Portfolio Fields Used for pages in the `__portfolio__/` directory. | Field | Type | Default | Description | |-------|------|---------|-------------| | `image` | string | - | Project thumbnail image path | | `links` | []object | - | Project links (each has `text` and `url`) | | `featured` | bool | false | Highlight project in the portfolio grid | ##### FAQ Fields Used for pages in the `__faq__/` directory or with FAQ-category items. | Field | Type | Description | |-------|------|-------------| | `question` | string | FAQ question text | | `category` | string | FAQ category name for grouping | ##### Version Fields Used when multi-version documentation is enabled via `versions.enabled: true` in config.yaml. Versioned pages live in `docs/__versions__/<version-name>/` directories. | Field | Type | Default | Description | |-------|------|---------|-------------| | `versions` | []string | all | Versions this page appears in (empty = all versions) | | `since` | string | - | Version where feature was introduced | | `deprecated_in` | string | - | Version where feature was deprecated | | `removed_in` | string | - | Version where feature was removed | | `version_note` | string | - | Note displayed for version context | **How it works:** - Pages in `docs/` appear in all versions by default - Pages in `docs/__versions__/v2/` only appear in the v2 version - The `versions` frontmatter field limits which versions a page appears in - `since` and `deprecated_in` render version badges on the page - `removed_in` hides the page from versions after removal **Directory structure:** ``` docs/ getting-started/ # Appears in all versions install.md __versions__/ v1/ migration.md # Only in v1 v2/ new-feature.md # Only in v2 ``` #### Examples ##### Minimal Page ```yaml --- title: Quick Start --- ``` ##### Documentation Page ```yaml --- title: API Authentication description: How to authenticate with the API tags: - api - authentication - security author: API Team --- ``` ##### Hidden Page ```yaml --- title: Internal Notes description: Notes not shown in navigation hidden: true --- ``` ##### Custom Navigation Order ```yaml --- title: Introduction menu_order: 1 --- ``` ```yaml --- title: Getting Started menu_order: 2 --- ``` ```yaml --- title: Advanced Topics menu_order: 99 --- ``` ##### SEO Optimized ```yaml --- title: MinimalDoc Documentation description: Complete guide to MinimalDoc seo: title: MinimalDoc - Static Site Generator for Docs description: Build beautiful documentation sites with MinimalDoc keywords: - documentation - static site generator - markdown image: /images/social-card.png canonical: https://minimaldoc.dev/docs --- ``` ##### Stable Content (No Stale Warning) ```yaml --- title: License Agreement description: Software license terms stale_warning: false --- ``` ##### Extended Threshold ```yaml --- title: Architecture Overview description: System architecture that rarely changes stale_threshold_days: 730 --- ``` ##### Version-Specific Page ```yaml --- title: New API Endpoint description: Available in v2 and later versions: - v2 - v3 since: "v2.0" --- ``` ##### Deprecated Feature ```yaml --- title: Legacy Authentication description: Use OAuth2 instead deprecated_in: "v2.0" removed_in: "v3.0" --- ``` #### Date Formats Supported date formats: ```yaml date: 2025-01-15 date: 2025-01-15T10:30:00Z date: 2025-01-15T10:30:00+02:00 ``` #### Validation MinimalDoc validates frontmatter and reports errors: ``` Error: docs/page.md: missing required field 'title' Error: docs/other.md: invalid date format '15/01/2025' ``` Missing optional fields use defaults silently. ## Theming *Customize appearance with CSS variables and custom themes* ### Theming MinimalDoc themes are CSS-only. Customize colors without editing templates. #### Built-in Themes | Theme | Description | |-------|-------------| | `default` | Clean, neutral colors | | `yellow` | Warm accent color | Set theme in config: ```yaml theme: default ``` Or via CLI: ```bash minimaldoc build --theme yellow ``` #### Dark Mode Dark mode is built into every theme. ##### Default Behavior Respects system preference (`prefers-color-scheme`). ##### Force Dark Mode ```yaml dark_mode: true ``` ##### Toggle Users can toggle via the button in the header. Preference persists in localStorage. #### CSS Variables Themes define CSS variables for light and dark modes: ```css /* Light mode */ :root[data-theme="light"] { --bg-primary: #fafafa; --bg-secondary: #f0f0f0; --bg-tertiary: #e8e8e8; --text-primary: #1a1a1a; --text-secondary: #666666; --text-tertiary: #999999; --text-muted: #bbbbbb; --border-primary: #e0e0e0; --border-secondary: #f0f0f0; --accent-primary: #007bff; --accent-hover: #0056b3; --link-color: #0066cc; --link-hover: #0052a3; --bg-code: #f5f5f5; --bg-hover: #f0f0f0; --shadow-sm: 0 1px 2px rgba(0,0,0,0.05); --shadow-md: 0 4px 6px rgba(0,0,0,0.1); } /* Dark mode */ :root[data-theme="dark"] { --bg-primary: #1a1a1a; --bg-secondary: #2d2d2d; --bg-tertiary: #3a3a3a; --text-primary: #f5f5f5; --text-secondary: #b0b0b0; --text-tertiary: #888888; --text-muted: #666666; --border-primary: #444444; --border-secondary: #333333; --accent-primary: #4a9eff; --accent-hover: #357abd; --link-color: #66b3ff; --link-hover: #99ccff; --bg-code: #0d1117; --bg-hover: #2d2d2d; --shadow-sm: 0 1px 2px rgba(0,0,0,0.3); --shadow-md: 0 4px 6px rgba(0,0,0,0.5); } ``` #### Variable Reference ##### Backgrounds | Variable | Usage | |----------|-------| | `--bg-primary` | Main page background | | `--bg-secondary` | Sidebar, cards | | `--bg-tertiary` | Nested elements | | `--bg-code` | Code blocks | | `--bg-hover` | Hover states | ##### Text | Variable | Usage | |----------|-------| | `--text-primary` | Main content | | `--text-secondary` | Secondary text | | `--text-tertiary` | Muted text | | `--text-muted` | Very light text | ##### Borders | Variable | Usage | |----------|-------| | `--border-primary` | Main borders | | `--border-secondary` | Subtle borders | ##### Accents | Variable | Usage | |----------|-------| | `--accent-primary` | Buttons, highlights | | `--accent-hover` | Hover states | | `--link-color` | Link text | | `--link-hover` | Link hover | ##### Shadows | Variable | Usage | |----------|-------| | `--shadow-sm` | Subtle elevation | | `--shadow-md` | Cards, dropdowns | #### Config-Based Theming Customize colors, fonts, and hero styling directly in `config.yaml` without creating theme files. ##### Theme Configuration ```yaml theme_config: name: "custom" colors: light: bg_primary: "#ffffff" bg_secondary: "#f8f9fa" text_primary: "#212529" link_color: "#0066cc" dark: bg_primary: "#0f172a" bg_secondary: "#1e293b" text_primary: "#f8fafc" link_color: "#60a5fa" fonts: heading: "Inter" body: "Inter" code: "JetBrains Mono" google_url: "https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=JetBrains+Mono&display=swap" hero: background_image: "/images/hero-bg.jpg" background_overlay: "rgba(0,0,0,0.6)" text_align: "center" min_height: "80vh" ``` ##### Color Options | Field | Description | |-------|-------------| | `bg_primary` | Main page background | | `bg_secondary` | Sidebar, cards | | `bg_tertiary` | Nested elements | | `bg_code` | Code block background | | `bg_hover` | Hover states | | `text_primary` | Main text | | `text_secondary` | Secondary text | | `text_tertiary` | Muted text | | `text_muted` | Very light text | | `border_primary` | Main borders | | `border_secondary` | Subtle borders | | `accent_primary` | Buttons, highlights | | `accent_hover` | Accent hover state | | `link_color` | Link text | | `link_hover` | Link hover | ##### Font Options | Field | Description | |-------|-------------| | `heading` | Font family for headings | | `body` | Font family for body text | | `code` | Font family for code | | `google_url` | Google Fonts import URL | ##### Hero Options | Field | Description | |-------|-------------| | `background_image` | Hero background image URL | | `background_overlay` | Overlay color (e.g., `rgba(0,0,0,0.6)`) | | `text_align` | Text alignment: `left`, `center`, `right` | | `min_height` | Minimum hero height (e.g., `80vh`) | ##### Partial Configuration Only specify values you want to override. Unspecified values use theme defaults: ```yaml theme_config: colors: light: link_color: "#ff6600" dark: link_color: "#ff9933" ``` #### Creating Custom Themes (File-Based) 1. Create theme directory: ``` themes/ └── my-theme/ └── static/ └── css/ └── main.css ``` 2. Define variables in `main.css`: ```css /* my-theme/static/css/main.css */ :root[data-theme="light"] { --bg-primary: #ffffff; --bg-secondary: #f8f9fa; --text-primary: #212529; --accent-primary: #6366f1; /* ... other variables */ } :root[data-theme="dark"] { --bg-primary: #0f172a; --bg-secondary: #1e293b; --text-primary: #f1f5f9; --accent-primary: #818cf8; /* ... other variables */ } ``` 3. Use your theme: ```bash minimaldoc build --theme my-theme ``` #### Custom Fonts Add font import and override: ```css @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap'); body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; } code, pre { font-family: 'JetBrains Mono', 'Fira Code', monospace; } ``` #### Theme Structure ``` themes/ ├── common/ # Shared (don't modify) │ ├── templates/ # HTML templates │ └── static/ │ ├── css/ # Base styles │ └── js/ # JavaScript ├── default/ # Default theme │ └── static/css/main.css # Variables only (~65 lines) └── yellow/ # Yellow theme └── static/css/main.css # Variables + font ``` Themes only contain CSS variables. All HTML and JS is shared. #### Admonition Colors Admonition colors can be customized: ```css .admonition.info { --admonition-bg: #e3f2fd; --admonition-border: #2196f3; --admonition-text: #1565c0; } .admonition.warning { --admonition-bg: #fff3e0; --admonition-border: #ff9800; --admonition-text: #e65100; } /* Add dark mode variants */ [data-theme="dark"] .admonition.info { --admonition-bg: rgba(33, 150, 243, 0.1); --admonition-border: #2196f3; --admonition-text: #90caf9; } ``` ## Configuration *Complete config.yaml reference for MinimalDoc* ### Configuration MinimalDoc is configured via `config.yaml` in your docs root. CLI flags override config values. #### Precedence 1. CLI flags (highest) 2. config.yaml 3. Defaults (lowest) #### Minimal Config The smallest useful config: ```yaml title: My Docs ``` Everything else has sensible defaults. Add sections as needed. #### Full Config Reference ##### Basic Settings ```yaml title: My Documentation description: Project documentation site base_url: https://docs.example.com author: Your Name theme: default dark_mode: false enable_llms: true enable_search: true clean_urls: false entrypoint: index.md nav_depth: 0 ``` | Field | Type | Default | Description | |-------|------|---------|-------------| | `title` | string | `"Documentation"` | Site title shown in header and meta tags | | `description` | string | `""` | Site description for SEO meta tags | | `base_url` | string | `""` | Base URL for absolute links, sitemap, and RSS feeds | | `author` | string | `""` | Default author for meta tags | | `theme` | string | `"default"` | Theme name | | `dark_mode` | bool | `false` | Start in dark mode by default | | `enable_llms` | bool | `true` | Generate `llms.txt`, `llms-full.txt`, and per-page `.html.md` files | | `enable_search` | bool | `true` | Enable client-side search with Cmd+K shortcut | | `clean_urls` | bool | `false` | Use `/page/` instead of `/page.html` | | `entrypoint` | string | `""` | Custom homepage file (default: `index.md`) | | `nav_depth` | int | `0` | Max depth for navigation tree (0 = unlimited) | ##### Theme Customization Override colors, fonts, and hero styling: ```yaml theme_config: colors: light: bg_primary: "#ffffff" bg_secondary: "#f8f9fa" text_primary: "#1a1a2e" link_color: "#2563eb" accent_primary: "#2563eb" dark: bg_primary: "#0f0f23" bg_secondary: "#1a1a2e" text_primary: "#e2e8f0" link_color: "#60a5fa" accent_primary: "#60a5fa" fonts: heading: "Inter" body: "Inter" code: "JetBrains Mono" google_url: "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" hero: background_image: "/images/hero-bg.jpg" background_overlay: "rgba(0,0,0,0.6)" text_align: center min_height: "80vh" ``` **Color fields** (available in both `light` and `dark`): | Field | Description | |-------|-------------| | `bg_primary` | Main background | | `bg_secondary` | Sidebar, cards | | `bg_tertiary` | Code blocks, subtle areas | | `bg_code` | Inline code background | | `bg_hover` | Hover state background | | `text_primary` | Main text | | `text_secondary` | Subtitles, descriptions | | `text_tertiary` | Muted text | | `text_muted` | Least prominent text | | `border_primary` | Main borders | | `border_secondary` | Subtle borders | | `accent_primary` | Buttons, active states | | `accent_hover` | Accent hover | | `link_color` | Link text | | `link_hover` | Link hover | | `color_success` | Success indicators | | `color_warning` | Warning indicators | | `color_danger` | Error indicators | | `color_info` | Info indicators | ##### OpenAPI Generate interactive API documentation from OpenAPI/Swagger specs: ```yaml openapi: enabled: true spec_files: - petstore.yaml - internal-api.json spec_urls: - https://api.example.com/openapi.json default_view: path sync_on_build: false cache_dir: .openapi-cache enable_testing: true enable_export: true enable_code_samples: true ``` | Field | Type | Default | Description | |-------|------|---------|-------------| | `enabled` | bool | `false` | Enable OpenAPI docs generation | | `spec_files` | []string | `[]` | Local spec files relative to docs root | | `spec_urls` | []string | `[]` | Remote spec URLs to fetch | | `default_view` | string | `"path"` | Organization: `path`, `tag`, or `flat` | | `sync_on_build` | bool | `false` | Fetch remote specs on every build | | `cache_dir` | string | `".openapi-cache"` | Cache directory for remote specs | | `enable_testing` | bool | `true` | Show "Try It" interface for endpoints | | `enable_export` | bool | `true` | Enable cURL export | | `enable_code_samples` | bool | `true` | Show code samples (curl, fetch, Go, Python) | Spec files go in an `api/` subdirectory by default (configurable via `--openapi-dir` CLI flag). ##### MCP Server Documentation Generate reference pages from `.mcp.json` manifests (like Swagger for MCP): ```yaml mcp: enabled: true spec_files: - "*.mcp.json" path: mcp ``` | Field | Type | Default | Description | |-------|------|---------|-------------| | `enabled` | bool | `false` | Enable MCP docs generation | | `spec_files` | []string | `[]` | JSON manifest file paths/globs relative to docs root | | `path` | string | `"mcp"` | Output URL path | Place `.mcp.json` files in an `mcp/` subdirectory by default (configurable via `--mcp-dir` CLI flag). ##### Status Page Track service health with incidents, maintenance windows, and uptime: ```yaml status: enabled: true title: Service Status description: Current system status path: status show_history: true history_months: 12 rss_enabled: true ``` | Field | Type | Default | Description | |-------|------|---------|-------------| | `enabled` | bool | `false` | Enable status page | | `title` | string | `"Service Status"` | Page title | | `description` | string | `""` | Page description | | `path` | string | `"status"` | Output path | | `show_history` | bool | `true` | Show incident history | | `history_months` | int | `12` | Months of history to display | | `rss_enabled` | bool | `true` | Generate RSS feed | Status data is defined as markdown files in `__status__/` directory. See the status page guide for file format. ##### Changelog Version history with RSS feed: ```yaml changelog: enabled: true title: Changelog description: Release history path: changelog rss_enabled: true repository: https://github.com/org/repo ``` | Field | Type | Default | Description | |-------|------|---------|-------------| | `enabled` | bool | `false` | Enable changelog | | `title` | string | `"Changelog"` | Page title | | `description` | string | `""` | Page description | | `path` | string | `"changelog"` | Output path | | `rss_enabled` | bool | `true` | Generate RSS feed | | `repository` | string | `""` | GitHub repository URL for version compare links | Releases are defined as markdown files in `__changelog__/releases/` directory. ##### Landing Page Marketing-style homepage with hero, features, steps, and CTA sections: ```yaml landing: enabled: true nav: - text: Docs url: /getting-started/installation.html - text: Features url: /features/overview.html hero: title: Documentation Made Simple subtitle: A minimal static site generator buttons: - text: Get Started url: /getting-started/installation.html primary: true - text: GitHub url: https://github.com/org/repo primary: false features: title: Features items: - emoji: "~" title: Markdown-based description: Write in plain Markdown with YAML frontmatter. - emoji: "@" title: Lightning Fast description: Sub-second builds powered by Go. steps: title: Quick Start items: - title: Install description: Download the binary code: "curl -sSL https://example.com/install.sh | bash" - title: Build description: Generate your site code: "minimaldoc build" cta: title: Ready to start? description: Get up and running in minutes. buttons: - text: Download url: https://github.com/org/repo/releases primary: true opensource: title: Open Source description: GPL-3.0 Licensed. links: - text: GitHub url: https://github.com/org/repo links: title: Resources items: - icon: github title: GitHub description: Source code url: https://github.com/org/repo ``` Landing sections can also be defined as markdown files in a `__landing__/` directory. Markdown files override YAML config values. Additional landing section types: `testimonials`, `image_text`, `text_blocks`, `links_grid`. ##### Portfolio Project showcase with filterable tags: ```yaml portfolio: enabled: true title: Projects description: Sites built with our tool path: projects ``` | Field | Type | Default | Description | |-------|------|---------|-------------| | `enabled` | bool | `false` | Enable portfolio | | `title` | string | `"Projects"` | Page title | | `description` | string | `""` | Page description | | `path` | string | `"projects"` | Output path | Projects are defined as markdown files in `__portfolio__/` directory with frontmatter for tags, images, and URLs. ##### Knowledge Base Categorized articles with search: ```yaml knowledgebase: enabled: true title: Knowledge Base description: Find answers and guides path: kb search: enabled: true placeholder: "Search articles..." categories: getting-started: name: Getting Started description: Installation and setup icon: rocket order: 1 troubleshooting: name: Troubleshooting description: Common issues and solutions icon: wrench order: 2 ``` | Field | Type | Default | Description | |-------|------|---------|-------------| | `enabled` | bool | `false` | Enable knowledge base | | `title` | string | `"Knowledge Base"` | Page title | | `description` | string | `""` | Page description | | `path` | string | `"kb"` | Output path | | `search.enabled` | bool | `true` | Enable search within KB | | `search.placeholder` | string | `""` | Search input placeholder text | | `categories` | map | `{}` | Category definitions keyed by directory name | Articles are markdown files in `__kb__/<category>/` directories. ##### Roadmap Visual roadmap with board or timeline layout: ```yaml roadmap: enabled: true title: Roadmap description: What we're building next layout: board show_versions: true path: roadmap columns: - id: planned label: Planned - id: in_progress label: In Progress - id: shipped label: Shipped items: - title: Dark mode description: System-aware theme switching status: shipped version: v1.0 tags: [ui, theme] shipped_date: "2025-01-15" changelog_url: "/changelog/#v1.0" - title: Plugin system description: Extensible plugin architecture status: planned version: v2.0 tags: [architecture] ``` | Field | Type | Default | Description | |-------|------|---------|-------------| | `enabled` | bool | `false` | Enable roadmap page | | `title` | string | `"Roadmap"` | Page title | | `description` | string | `""` | Page description | | `layout` | string | `"board"` | Layout: `board` or `timeline` | | `show_versions` | bool | `false` | Show version badges | | `path` | string | `"roadmap"` | Output path | | `columns` | array | `[]` | Board columns with `id` and `label` | | `items[].status` | string | | Must match a column `id` | | `items[].tags` | []string | | Filterable tags | | `items[].shipped_date` | string | | Date shipped (YYYY-MM-DD) | | `items[].changelog_url` | string | | Link to changelog entry | ##### FAQ Frequently asked questions page: ```yaml faq: enabled: true title: FAQ description: Frequently asked questions path: faq categories: - name: General items: - question: What is this? answer: A documentation generator. - question: Is it free? answer: Yes, GPL-3.0 licensed. - name: Technical items: - question: What languages are supported? answer: 100+ via Chroma syntax highlighting. ``` FAQ items can also be defined as markdown files in `__faq__/` directory with frontmatter containing `question`, `category`, and `tags` fields. ##### Contact Contact page with info cards: ```yaml contact: enabled: true title: Contact description: Get in touch path: contact email: hello@example.com info: - icon: mail text: hello@example.com - icon: location text: Montreal, Canada ``` ##### Legal Legal pages (privacy policy, terms of service): ```yaml legal: enabled: true path: legal footer_group: Legal ``` Legal pages are markdown files in `__legal__/` directory. Each file becomes a page under the configured path and is automatically added to the footer group. ##### Stale Warning Show warnings on outdated content: ```yaml stale_warning: enabled: true threshold_days: 365 message: "This page may be outdated." show_update_date: true ``` | Field | Type | Default | Description | |-------|------|---------|-------------| | `enabled` | bool | `false` | Enable stale warnings | | `threshold_days` | int | `365` | Days before content is flagged stale | | `message` | string | `""` | Custom warning message (auto-generated if empty) | | `show_update_date` | bool | `true` | Show last modified date | ##### PDF Export Add an "Export PDF" button to each page: ```yaml pdf_export: enabled: true page_break_level: 2 ``` | Field | Type | Default | Description | |-------|------|---------|-------------| | `enabled` | bool | `false` | Enable PDF export button | | `page_break_level` | int | `1` | Heading level for page breaks: 0=none, 1=h1 only, 2=h1+h2 | ##### Claude Assist Add an "Ask Claude" button that opens Claude with the page context: ```yaml claude_assist: enabled: true label: Ask Claude prompt: "Answer based on this documentation:" ``` | Field | Type | Default | Description | |-------|------|---------|-------------| | `enabled` | bool | `false` | Enable Claude assist button | | `label` | string | `"Ask Claude"` | Button label text | | `prompt` | string | `""` | Custom prompt prefix (optional) | ##### Versioned Documentation Serve multiple versions of your docs: ```yaml versions: enabled: true default: v1.2 list: - name: v1.2 label: "1.2.x (Latest)" path: "" - name: v1.1 label: "1.1.x" path: v1.1 - name: v1.0 label: "1.0.x (EOL)" path: v1.0 eol: "2025-06-01" selector: position: header show_eol_warning: true ``` | Field | Type | Default | Description | |-------|------|---------|-------------| | `enabled` | bool | `false` | Enable multi-version docs | | `default` | string | `""` | Default version slug | | `list[].name` | string | | Version identifier | | `list[].label` | string | | Display label in version selector | | `list[].path` | string | | URL path prefix (empty = root) | | `list[].eol` | string | | End-of-life date (YYYY-MM-DD) | | `selector.position` | string | `"header"` | `header` or `sidebar` | | `selector.show_eol_warning` | bool | `false` | Show warning badge for EOL versions | Versioned content goes in `__versions__/<version-name>/` directories. ##### Internationalization (i18n) Serve docs in multiple languages: ```yaml i18n: enabled: true default_locale: en hide_default_locale: true show_untranslated: true fallback: en locales: - code: en name: English direction: ltr - code: fr name: Francais direction: ltr - code: ar name: Arabic direction: rtl selector: position: header show_flags: false ``` | Field | Type | Default | Description | |-------|------|---------|-------------| | `enabled` | bool | `false` | Enable i18n | | `default_locale` | string | `"en"` | Default locale code | | `hide_default_locale` | bool | `false` | Omit locale prefix for default (use `/page.html` not `/en/page.html`) | | `show_untranslated` | bool | `false` | Show fallback content with untranslated badge | | `fallback` | string | `""` | Fallback locale for missing translations | | `locales[].code` | string | | Locale code (e.g., `en`, `fr`, `de`) | | `locales[].name` | string | | Display name | | `locales[].direction` | string | | Text direction: `ltr` or `rtl` | | `selector.position` | string | `"header"` | `header` or `sidebar` | | `selector.show_flags` | bool | `false` | Show flag icons | Translated content goes in `__i18n__/<locale-code>/` directories mirroring the main docs structure. ##### Analytics Add analytics tracking: ```yaml analytics: enabled: true providers: - type: plausible enabled: true config: domain: docs.example.com - type: ga4 enabled: true config: measurement_id: G-XXXXXXXXXX ``` | Field | Type | Default | Description | |-------|------|---------|-------------| | `enabled` | bool | `false` | Enable analytics | | `providers[].type` | string | | Provider: `ga4`, `plausible`, `umami`, `matomo`, `fathom`, `simple`, `custom` | | `providers[].enabled` | bool | | Enable this provider | | `providers[].config` | map | | Provider-specific configuration | ##### Link Checking Validate internal and external links during build: ```yaml link_check: enabled: true mode: warn check_external: false external_timeout: 10 ignore_patterns: - "*/archive/*" allowed_broken: - "/legacy/old-page.html" ``` | Field | Type | Default | Description | |-------|------|---------|-------------| | `enabled` | bool | `true` | Enable link checking | | `mode` | string | `"warn"` | `error` (fail build) or `warn` (report only) | | `check_external` | bool | `false` | Check external URLs | | `external_timeout` | int | `10` | Timeout in seconds for external checks | | `ignore_patterns` | []string | `[]` | Glob patterns to skip | | `allowed_broken` | []string | `[]` | Known broken links to ignore | ##### Footer Configure the site-wide footer: ```yaml footer: copyright: "2026 Company. GPL-3.0 License." hideVersion: false links: - title: Documentation items: - text: Getting Started url: /getting-started/installation.html - text: Configuration url: /getting-started/configuration.html - title: Resources items: - text: GitHub url: https://github.com/org/repo social: - name: GitHub url: https://github.com/org/repo icon: github - name: Discord url: https://discord.gg/invite icon: discord badges: - text: "Powered by MinimalDoc" url: https://minimaldoc.com ``` ##### Social Links (Sidebar) Social links shown in the sidebar: ```yaml social_links: - name: GitHub url: https://github.com/org/repo icon: github - name: Discord url: https://discord.gg/invite icon: discord ``` Available icons: `github`, `twitter`, `linkedin`, `youtube`, `discord`, `mastodon`, `rss`, `email`, `website`. ##### Custom Fields Pass arbitrary data to templates: ```yaml custom: ga_id: G-XXXXXXXXXX show_banner: true ``` Access in templates via `{{.Site.Config.Custom.ga_id}}`. #### CLI Flags CLI flags override config.yaml values: ```bash minimaldoc build [docs-dir] [flags] ``` | Flag | Short | Default | Description | |------|-------|---------|-------------| | `--output` | `-o` | `public` | Output directory | | `--theme` | `-t` | `default` | Theme name | | `--title` | | `Documentation` | Site title | | `--description` | | | Site description | | `--base-url` | | | Base URL | | `--llms` | `-l` | `true` | Generate llms.txt | | `--clean-urls` | | `false` | Use clean URLs | | `--openapi` | | `false` | Enable OpenAPI | | `--openapi-dir` | | `api` | OpenAPI specs directory | | `--mcp` | | `false` | Enable MCP docs | | `--mcp-dir` | | `mcp` | MCP manifests directory | | `--status` | | `false` | Enable status page | | `--status-title` | | `Service Status` | Status page title | | `--status-path` | | `status` | Status page path | | `--changelog` | | `false` | Enable changelog | | `--changelog-title` | | `Changelog` | Changelog page title | | `--stale-warning` | | `false` | Enable stale warnings | | `--stale-threshold` | | `365` | Stale threshold in days | | `--link-check` | | `warn` | Link check mode: `error`, `warn`, `ignore` | #### Common Patterns ##### Docs-only (minimal) ```yaml title: API Reference base_url: https://docs.example.com enable_search: true ``` ##### Full documentation site ```yaml title: My Project base_url: https://docs.example.com enable_search: true enable_llms: true clean_urls: true openapi: enabled: true spec_files: [openapi.yaml] changelog: enabled: true repository: https://github.com/org/repo status: enabled: true stale_warning: enabled: true threshold_days: 180 pdf_export: enabled: true claude_assist: enabled: true ``` ##### Marketing site with docs ```yaml title: My Product base_url: https://example.com landing: enabled: true hero: title: Build Faster subtitle: Ship documentation in minutes buttons: - text: Get Started url: /getting-started/installation.html primary: true portfolio: enabled: true faq: enabled: true contact: enabled: true roadmap: enabled: true layout: board ``` ## Custom Themes *Create custom themes with CSS variables* ### Custom Themes Create themes by defining CSS variables. No template editing required. #### Theme Structure ``` themes/ ├── common/ # Shared (don't modify) │ ├── templates/ │ └── static/ │ ├── css/ │ └── js/ ├── default/ # Default theme │ └── static/css/main.css └── my-theme/ # Your custom theme └── static/css/main.css ``` #### Creating a Theme ##### 1. Create Directory ```bash mkdir -p themes/my-theme/static/css ``` ##### 2. Create main.css ```css /* themes/my-theme/static/css/main.css */ /* Light mode */ :root[data-theme="light"] { --bg-primary: #ffffff; --bg-secondary: #f8fafc; --bg-tertiary: #f1f5f9; --text-primary: #0f172a; --text-secondary: #475569; --text-tertiary: #94a3b8; --text-muted: #cbd5e1; --border-primary: #e2e8f0; --border-secondary: #f1f5f9; --accent-primary: #3b82f6; --accent-hover: #2563eb; --link-color: #2563eb; --link-hover: #1d4ed8; --bg-code: #f8fafc; --bg-hover: #f1f5f9; --shadow-sm: 0 1px 2px rgba(0,0,0,0.05); --shadow-md: 0 4px 6px rgba(0,0,0,0.1); } /* Dark mode */ :root[data-theme="dark"] { --bg-primary: #0f172a; --bg-secondary: #1e293b; --bg-tertiary: #334155; --text-primary: #f8fafc; --text-secondary: #cbd5e1; --text-tertiary: #94a3b8; --text-muted: #64748b; --border-primary: #334155; --border-secondary: #1e293b; --accent-primary: #60a5fa; --accent-hover: #3b82f6; --link-color: #60a5fa; --link-hover: #93c5fd; --bg-code: #1e293b; --bg-hover: #334155; --shadow-sm: 0 1px 2px rgba(0,0,0,0.3); --shadow-md: 0 4px 6px rgba(0,0,0,0.5); } ``` ##### 3. Use Your Theme ```bash minimaldoc build --theme my-theme ``` Or in config: ```yaml theme: my-theme ``` #### CSS Variables Reference ##### Backgrounds | Variable | Purpose | |----------|---------| | `--bg-primary` | Page background | | `--bg-secondary` | Sidebar, cards | | `--bg-tertiary` | Nested elements, highlights | | `--bg-code` | Code block background | | `--bg-hover` | Hover states | ##### Text | Variable | Purpose | |----------|---------| | `--text-primary` | Main content | | `--text-secondary` | Secondary text, descriptions | | `--text-tertiary` | Muted text | | `--text-muted` | Very subtle text | ##### Borders | Variable | Purpose | |----------|---------| | `--border-primary` | Main borders | | `--border-secondary` | Subtle borders | ##### Accents | Variable | Purpose | |----------|---------| | `--accent-primary` | Buttons, active states | | `--accent-hover` | Hover on accent elements | | `--link-color` | Link text | | `--link-hover` | Link hover | ##### Shadows | Variable | Purpose | |----------|---------| | `--shadow-sm` | Subtle depth | | `--shadow-md` | Cards, dropdowns | #### Custom Fonts ##### Google Fonts ```css @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap'); :root { --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; } body { font-family: var(--font-sans); } ``` ##### Monospace Font ```css @import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono&display=swap'); code, pre { font-family: 'JetBrains Mono', 'Fira Code', monospace; } ``` ##### Self-Hosted Fonts ```css @font-face { font-family: 'CustomFont'; src: url('/fonts/custom.woff2') format('woff2'); font-weight: normal; font-style: normal; font-display: swap; } ``` #### Theme Examples ##### Warm Theme ```css :root[data-theme="light"] { --bg-primary: #fffbeb; --bg-secondary: #fef3c7; --text-primary: #78350f; --accent-primary: #f59e0b; --link-color: #d97706; } :root[data-theme="dark"] { --bg-primary: #1c1917; --bg-secondary: #292524; --text-primary: #fef3c7; --accent-primary: #fbbf24; --link-color: #fcd34d; } ``` ##### Cool Theme ```css :root[data-theme="light"] { --bg-primary: #f0f9ff; --bg-secondary: #e0f2fe; --text-primary: #0c4a6e; --accent-primary: #0284c7; --link-color: #0369a1; } :root[data-theme="dark"] { --bg-primary: #0c1929; --bg-secondary: #1e3a5f; --text-primary: #e0f2fe; --accent-primary: #38bdf8; --link-color: #7dd3fc; } ``` ##### High Contrast ```css :root[data-theme="light"] { --bg-primary: #ffffff; --text-primary: #000000; --accent-primary: #0000ff; --border-primary: #000000; } :root[data-theme="dark"] { --bg-primary: #000000; --text-primary: #ffffff; --accent-primary: #00ffff; --border-primary: #ffffff; } ``` #### Admonition Colors Customize admonition appearance: ```css /* Info */ .admonition.info { --admonition-bg: #dbeafe; --admonition-border: #3b82f6; --admonition-text: #1e40af; } [data-theme="dark"] .admonition.info { --admonition-bg: rgba(59, 130, 246, 0.15); --admonition-text: #93c5fd; } /* Warning */ .admonition.warning { --admonition-bg: #fef3c7; --admonition-border: #f59e0b; --admonition-text: #92400e; } /* Danger */ .admonition.danger { --admonition-bg: #fee2e2; --admonition-border: #ef4444; --admonition-text: #991b1b; } ``` #### Code Block Colors Override syntax highlighting: ```css /* Code block background */ pre { background: var(--bg-code) !important; } /* Line numbers */ .chroma .ln { color: var(--text-muted); } ``` #### Testing Themes ##### Local Development ```bash # Build with theme minimaldoc build ./docs --theme my-theme --output dist # Serve locally python -m http.server -d dist 8080 ``` ##### Test Both Modes Toggle dark mode in browser to verify both color schemes. ##### Checklist - [ ] Light mode readable - [ ] Dark mode readable - [ ] Links visible - [ ] Code blocks legible - [ ] Admonitions distinct - [ ] Hover states visible - [ ] Borders appropriate - [ ] Search input styled #### Contributing Themes To add a theme to MinimalDoc, open a PR on the [GitHub repository](https://github.com/studiowebux/minimaldoc). ## OpenAPI Views *Organize API endpoints by path, tag, or flat list* ### OpenAPI Views MinimalDoc provides three ways to organize API endpoints. #### View Modes ##### Path View Group endpoints by URL path hierarchy: ``` /users GET List users POST Create user /users/{id} GET Get user PUT Update user DELETE Delete user /orders GET List orders POST Create order ``` Set as default: ```yaml openapi: default_view: "path" ``` ##### Tag View Group endpoints by OpenAPI tags: ``` Users GET /users List users POST /users Create user GET /users/{id} Get user PUT /users/{id} Update user DELETE /users/{id} Delete user Orders GET /orders List orders POST /orders Create order GET /orders/{id} Get order ``` Set as default: ```yaml openapi: default_view: "tag" ``` Requires tags in your spec: ```yaml paths: /users: get: tags: - Users summary: List users ``` ##### Flat View All endpoints in a single list: ``` GET /users List users POST /users Create user GET /users/{id} Get user PUT /users/{id} Update user DELETE /users/{id} Delete user GET /orders List orders POST /orders Create order ``` Set as default: ```yaml openapi: default_view: "flat" ``` #### Switching Views Users can switch views via tabs in the UI: ``` [Path] [Tag] [Flat] [Schemas] ``` The default view is shown initially. #### Single Endpoint View Click any endpoint to see focused documentation: ``` GET /users/{id} Description: Get a specific user by ID Parameters: id (path, required): User ID Responses: 200: User found 404: User not found ``` Includes: - Full description - Parameters table - Request body schema - Response schemas - Code samples - Try It interface #### Navigation ##### Collapsible Groups Path and tag groups collapse/expand: ``` ▼ /users GET List users POST Create user ▶ /orders (collapsed) ``` Large APIs start collapsed for performance. ##### Search Filter endpoints by typing: ``` Search: [user ] Results: GET /users List users POST /users Create user GET /users/{id} Get user ``` ##### Method Colors HTTP methods are color-coded: | Method | Color | |--------|-------| | GET | Green | | POST | Blue | | PUT | Orange | | PATCH | Yellow | | DELETE | Red | #### Schemas Tab Dedicated view for data models: ``` [Path] [Tag] [Flat] [Schemas] Schemas: User Order Product Error ``` Click to expand schema details: ``` User (object) ├── id (integer, required) ├── name (string, required) ├── email (string, format: email) └── created_at (string, format: date-time) ``` ## Incidents *Document and track service incidents* ### Incidents Incidents document service issues and their resolution. #### File Structure Place incidents in `__status__/incidents/`: ``` __status__/ └── incidents/ ├── 2025-01-28-api-outage.md ├── 2025-01-15-database-latency.md └── 2025-01-10-cdn-issue.md ``` Filename format: `YYYY-MM-DD-short-description.md` #### Basic Format ```markdown --- title: API Service Outage status: resolved severity: major affected_components: - api created_at: 2025-01-28T10:00:00Z resolved_at: 2025-01-28T12:30:00Z --- ## Update - 12:30 UTC Issue resolved. The root cause was identified as a misconfigured load balancer. ## Update - 11:15 UTC Identified the issue. Deploying fix. ## Update - 10:00 UTC Investigating reports of API unavailability. ``` #### Frontmatter Fields | Field | Type | Required | Description | | --------------------- | -------- | -------- | --------------------- | | `title` | string | Yes | Incident title | | `status` | string | Yes | Current status | | `severity` | string | Yes | Severity level | | `affected_components` | []string | No | Component IDs | | `created_at` | datetime | Yes | Start time (ISO 8601) | | `updated_at` | datetime | No | Last update time | | `resolved_at` | datetime | No | Resolution time | #### Status Values | Status | Description | Display | | --------------- | ----------------------- | ------- | | `investigating` | Initial investigation | Yellow | | `identified` | Root cause found | Orange | | `monitoring` | Fix applied, monitoring | Blue | | `resolved` | Fully resolved | Green | #### Severity Levels | Severity | Description | Impact | | ---------- | ------------------ | ------------------- | | `minor` | Low impact | Some users affected | | `major` | Significant impact | Most users affected | | `critical` | Service down | All users affected | #### Update Timeline Write updates as H2 headings with timestamps: ```markdown ## Update - 14:30 UTC Service fully restored. Post-mortem scheduled. ## Update - 13:45 UTC Fix deployed to production. Monitoring. ## Update - 12:00 UTC Identified root cause as database connection pool exhaustion. ## Update - 11:30 UTC Investigating elevated error rates on API endpoints. ``` Updates display newest first on the status page. ##### Timestamp Formats ```markdown ## Update - 14:30 UTC ## Update - 2:30 PM UTC ## Update - January 28, 14:30 UTC ## Update - 2025-01-28 14:30 UTC ``` #### Affected Components Link incidents to components: ```yaml affected_components: - api - web - mobile-api ``` Component IDs must match those in `components.yaml`. Effects: - Components show incident indicator - Uptime calculations include downtime - Filtering by component #### Examples ##### Investigating ```markdown --- title: Elevated API Latency status: investigating severity: minor affected_components: - api created_at: 2025-01-28T15:00:00Z --- ## Update - 15:00 UTC We are investigating reports of slow API responses. Some users may experience delays. ``` ##### Identified ```markdown --- title: Database Connection Issues status: identified severity: major affected_components: - database - api created_at: 2025-01-28T10:00:00Z --- ## Update - 10:45 UTC Root cause identified: connection pool exhaustion due to long-running queries. Working on fix. ## Update - 10:00 UTC Investigating database connectivity issues affecting API responses. ``` ##### Monitoring ```markdown --- title: CDN Outage status: monitoring severity: critical affected_components: - cdn created_at: 2025-01-28T08:00:00Z --- ## Update - 09:30 UTC CDN service restored. Monitoring for stability. ## Update - 08:30 UTC Identified issue with CDN provider. Working with vendor. ## Update - 08:00 UTC CDN serving errors for static assets. ``` ##### Resolved ```markdown --- title: Authentication Service Outage status: resolved severity: major affected_components: - api - web created_at: 2025-01-28T06:00:00Z resolved_at: 2025-01-28T07:15:00Z --- ## Update - 07:15 UTC Service fully restored. Root cause was an expired TLS certificate on the auth service. ## Update - 06:45 UTC Certificate renewed. Restarting services. ## Update - 06:15 UTC Identified expired certificate causing auth failures. ## Update - 06:00 UTC Users unable to log in. Investigating. ``` #### Post-Mortem Include post-mortem in resolved incidents: ```markdown --- title: Major API Outage status: resolved severity: critical affected_components: - api created_at: 2025-01-28T10:00:00Z resolved_at: 2025-01-28T14:00:00Z --- ## Post-Mortem **Duration:** 4 hours **Root Cause:** A deployment introduced a memory leak that caused API servers to crash under load. **Impact:** API was unavailable for all users during the incident. **Timeline:** - 10:00 - Deployment completed - 10:15 - First alerts triggered - 10:30 - Rollback initiated - 14:00 - Service restored **Action Items:** - Add memory usage monitoring - Improve deployment canary process - Update runbook for similar incidents ## Update - 14:00 UTC Service fully restored after rollback. ## Update - 10:30 UTC Rolling back recent deployment. ## Update - 10:00 UTC Investigating API unavailability. ``` #### Display Incidents appear on: 1. **Dashboard** - Active and recent incidents 2. **History Page** - All incidents, grouped by month 3. **Individual Pages** - Full incident details 4. **RSS Feed** - Updates for subscribers ## Navigation *Configure navigation with folder structure or custom TOC.md* ### Navigation MinimalDoc supports two navigation modes: automatic folder-based and custom TOC.md. #### Folder-Based Navigation Default mode. Navigation is generated from your directory structure. ``` docs/ ├── index.md # Home ├── 01-getting-started/ # Section │ ├── 01-installation.md # Page │ └── 02-quick-start.md # Page ├── 02-features/ # Section │ ├── 01-search.md │ └── 02-theming.md └── 03-api/ # Section └── reference.md ``` Generates: ``` - Home - Getting Started - Installation - Quick Start - Features - Search - Theming - API - Reference ``` ##### Ordering Rules 1. `menu_order` frontmatter (ascending, lowest first) 2. Numeric prefix (01-, 02-, etc.) 3. Alphabetical by filename Numeric prefixes are stripped from display: - `01-getting-started/` → "Getting Started" - `02-installation.md` → "Installation" ##### Frontmatter Override ```yaml --- title: Advanced Configuration menu_title: Advanced # Shorter nav title menu_order: 50 # Custom sort position --- ``` #### Custom Navigation with TOC.md Create `TOC.md` in your docs root for full control. ```markdown # My Project - [Home](index.md) - Getting Started - [Installation](getting-started/installation.md) - [Quick Start](getting-started/quick-start.md) - Features - [Search](features/search.md) - [Theming](features/theming.md) - [API Reference](api/reference.md) - Resources - [GitHub](https://github.com/org/repo) - [Issues](https://github.com/org/repo/issues) ``` ##### Format Rules Supported syntax: ```markdown - [Title](path.md) # Page link - Section Name # Section header (no link) - [External](https://...) # External link - [Nested](child.md) # 2-space indent for nesting ``` ##### Nesting ```markdown - Level 1 - Level 2 - Level 3 - Level 4 ``` No practical nesting limit, but 3-4 levels recommended for usability. ##### External Links ```markdown - Resources - [GitHub](https://github.com/studiowebux/minimaldoc) - [Discord](https://discord.gg/invite) ``` External links display with an icon and open in new tabs. ##### Mixed Navigation ```markdown - [Home](index.md) - Documentation - [Installation](docs/install.md) - [Configuration](docs/config.md) - [API Docs](api/index.md) - External - [GitHub](https://github.com/example) ``` #### Page Table of Contents Each page generates a right-side TOC from headings. ##### Included Headings - H2 through H6 are included - H1 is typically the page title, excluded from TOC ##### Scrollspy Active heading is highlighted as you scroll. Smooth scrolling enabled. ##### Anchor Links Click any heading to copy its anchor link: ``` https://example.com/docs/page.html#section-name ``` #### Hidden Pages Hide pages from navigation but keep them accessible: ```yaml --- title: Internal Notes hidden: true --- ``` Page is built and accessible via direct URL but not shown in navigation. #### Navigation Behavior ##### Active State Current page and its parent sections are highlighted. ##### Collapse Sections collapse/expand on click. Current section auto-expands. ##### Mobile On mobile, navigation is hidden behind a hamburger menu. ##### Keyboard - `Tab` navigates between links - `Enter` activates links - `Escape` closes mobile menu #### Examples ##### Documentation Site ```markdown - [Overview](index.md) - Getting Started - [Installation](getting-started/installation.md) - [Quick Start](getting-started/quick-start.md) - [Configuration](getting-started/configuration.md) - Guides - [Deployment](guides/deployment.md) - [Customization](guides/customization.md) - API Reference - [REST API](api/rest.md) - [SDK](api/sdk.md) - [Changelog](changelog.md) ``` ##### Product Documentation ```markdown - [Home](index.md) - User Guide - [Dashboard](user/dashboard.md) - [Reports](user/reports.md) - [Settings](user/settings.md) - Admin Guide - [Setup](admin/setup.md) - [Users](admin/users.md) - [Security](admin/security.md) - Developer - [API](dev/api.md) - [Webhooks](dev/webhooks.md) - Support - [FAQ](support/faq.md) - [Contact](https://support.example.com) ``` ## Admonitions *Callout blocks for important information, warnings, and tips* ### Admonitions Admonitions are callout blocks for highlighting important content. #### Syntax ```markdown :::type Content here ::: ``` Or with custom title: ```markdown :::type Custom Title Content here ::: ``` #### Available Types ##### Info ```markdown :::info This is an informational note. ::: ``` :::info This is an informational note. ::: ##### Warning ```markdown :::warning This requires attention. ::: ``` :::warning This requires attention. ::: ##### Danger ```markdown :::danger This action is irreversible. ::: ``` :::danger This action is irreversible. ::: ##### Success ```markdown :::success Operation completed successfully. ::: ``` :::success Operation completed successfully. ::: ##### Note ```markdown :::note A side note for additional context. ::: ``` :::note A side note for additional context. ::: ##### Question ```markdown :::question Frequently asked question format. ::: ``` :::question Frequently asked question format. ::: #### Custom Titles Override the default title: ```markdown :::info Prerequisites Make sure you have Go 1.24+ installed. ::: ``` :::info Prerequisites Make sure you have Go 1.24+ installed. ::: ```markdown :::warning Breaking Change This version changes the API format. ::: ``` :::warning Breaking Change This version changes the API format. ::: #### Markdown Inside Full Markdown is supported inside admonitions: ````markdown :::info **Bold**, *italic*, and `code` work here. - List item 1 - List item 2 ```bash echo "Code blocks too" ``` ::: ```` :::info **Bold**, *italic*, and `code` work here. - List item 1 - List item 2 ::: #### Color Reference | Type | Light BG | Dark BG | Use For | |------|----------|---------|---------| | `info` | Blue | Dark blue | General information | | `warning` | Yellow | Dark yellow | Cautions, deprecations | | `danger` | Red | Dark red | Critical warnings | | `success` | Green | Dark green | Confirmations | | `note` | Gray | Dark gray | Side notes | | `question` | Purple | Dark purple | FAQs | #### Usage Guidelines ##### When to Use **Info** - Background information, tips, explanations ```markdown :::info MinimalDoc generates static HTML files. ::: ``` **Warning** - Potential issues, deprecations, important notices ```markdown :::warning This feature is deprecated in v2.0. ::: ``` **Danger** - Breaking changes, data loss, security issues ```markdown :::danger This will delete all your data. ::: ``` **Success** - Completed steps, confirmations ```markdown :::success Your site is now deployed. ::: ``` **Note** - Tangential information, asides ```markdown :::note This is optional for basic usage. ::: ``` **Question** - FAQs, common questions ```markdown :::question How do I deploy? See the [deployment guide](../guides/deployment.md). ::: ``` ##### Avoid Overuse Too many admonitions reduce their impact: ```markdown <!-- Avoid this --> :::info Some info ::: :::warning A warning ::: :::note A note ::: Regular paragraph. :::info More info ::: ``` Use sparingly for truly important callouts. #### Styling Admonitions use CSS variables for colors: ```css .admonition { padding: 1rem; border-left: 4px solid var(--admonition-border); background: var(--admonition-bg); border-radius: 4px; margin: 1rem 0; } .admonition-title { font-weight: 600; margin-bottom: 0.5rem; } ``` See [Theming](03-theming.md) for customization. ## Prometheus Integration *Automate status page updates with Prometheus AlertManager* ### Prometheus Integration Automate status page updates using Prometheus AlertManager and GitHub Actions. #### Architecture ``` ┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐ │ Prometheus │────▶│ AlertManager │────▶│ GitHub Webhook │ │ (Monitoring) │ │ (Alert Router) │ │ (Receiver) │ └─────────────────┘ └──────────────────┘ └─────────────────┘ │ ▼ ┌─────────────────┐ │ GitHub Actions │ │ (Create/Update) │ └─────────────────┘ │ ▼ ┌─────────────────┐ │ Status Page │ │ (Rebuilt Site) │ └─────────────────┘ ``` #### Components | Component | Purpose | | -------------- | -------------------------------------- | | Prometheus | Monitor services, evaluate alert rules | | AlertManager | Route alerts, send webhooks | | GitHub Actions | Process alerts, update incident files | | MinimalDoc | Rebuild status page | #### Prometheus Alert Rules Create alert rules for your services: ```yaml # prometheus/rules/alerts.yml groups: - name: service-alerts rules: # Service Down - alert: ServiceDown expr: up == 0 for: 1m labels: severity: critical annotations: summary: "Service {{ $labels.job }} is down" description: "{{ $labels.job }} has been down for more than 1 minute" component_id: "{{ $labels.component }}" # High Latency - alert: HighLatency expr: http_request_duration_seconds{quantile="0.99"} > 1 for: 5m labels: severity: warning annotations: summary: "High latency on {{ $labels.job }}" description: "99th percentile latency is {{ $value }}s" component_id: "{{ $labels.component }}" # High Error Rate - alert: HighErrorRate expr: | sum(rate(http_requests_total{status=~"5.."}[5m])) by (job) / sum(rate(http_requests_total[5m])) by (job) > 0.05 for: 5m labels: severity: major annotations: summary: "High error rate on {{ $labels.job }}" description: "Error rate is {{ $value | humanizePercentage }}" component_id: "{{ $labels.component }}" # Database Connection Pool - alert: DatabaseConnectionPoolExhausted expr: pg_stat_activity_count >= pg_settings_max_connections * 0.9 for: 5m labels: severity: critical annotations: summary: "Database connection pool near exhaustion" description: "{{ $value }} of {{ $labels.max_connections }} connections in use" component_id: "database" ``` #### AlertManager Configuration Configure AlertManager to send webhooks to GitHub: ```yaml # alertmanager/config.yml global: resolve_timeout: 5m route: receiver: "github-status" group_by: ["alertname", "component_id"] group_wait: 30s group_interval: 5m repeat_interval: 4h routes: # Critical alerts - immediate - match: severity: critical receiver: "github-status" group_wait: 10s # Warning alerts - batched - match: severity: warning receiver: "github-status" group_wait: 2m receivers: - name: "github-status" webhook_configs: - url: "https://api.github.com/repos/YOUR_ORG/YOUR_REPO/dispatches" http_config: authorization: type: Bearer credentials_file: /etc/alertmanager/secrets/github-token send_resolved: true max_alerts: 10 ``` ##### GitHub Token Create a fine-grained Personal Access Token with: - Repository access: Your docs repository - Permissions: Contents (read/write), Actions (write) Store securely: ```bash # Create secret file echo "ghp_your_token_here" > /etc/alertmanager/secrets/github-token chmod 600 /etc/alertmanager/secrets/github-token ``` #### GitHub Actions Workflow Create workflow to process alerts: ```yaml # .github/workflows/status-update.yml name: Update Status Page on: repository_dispatch: types: [alertmanager] jobs: process-alert: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Process Alert Payload id: process run: | # Extract alert data ALERTS='${{ toJson(github.event.client_payload.alerts) }}' # Get first alert details STATUS=$(echo "$ALERTS" | jq -r '.[0].status') ALERTNAME=$(echo "$ALERTS" | jq -r '.[0].labels.alertname') SEVERITY=$(echo "$ALERTS" | jq -r '.[0].labels.severity') COMPONENT=$(echo "$ALERTS" | jq -r '.[0].annotations.component_id // "unknown"') SUMMARY=$(echo "$ALERTS" | jq -r '.[0].annotations.summary') DESCRIPTION=$(echo "$ALERTS" | jq -r '.[0].annotations.description') # Generate incident ID DATE=$(date +%Y-%m-%d) INCIDENT_ID="${DATE}-${ALERTNAME,,}" # Set outputs echo "status=$STATUS" >> $GITHUB_OUTPUT echo "alertname=$ALERTNAME" >> $GITHUB_OUTPUT echo "severity=$SEVERITY" >> $GITHUB_OUTPUT echo "component=$COMPONENT" >> $GITHUB_OUTPUT echo "summary=$SUMMARY" >> $GITHUB_OUTPUT echo "description=$DESCRIPTION" >> $GITHUB_OUTPUT echo "incident_id=$INCIDENT_ID" >> $GITHUB_OUTPUT echo "date=$DATE" >> $GITHUB_OUTPUT - name: Create or Update Incident run: | INCIDENT_FILE="docs/__status__/incidents/${{ steps.process.outputs.incident_id }}.md" TIMESTAMP=$(date -u +"%H:%M UTC") if [ "${{ steps.process.outputs.status }}" == "firing" ]; then # Create new incident or add update if [ ! -f "$INCIDENT_FILE" ]; then # New incident cat > "$INCIDENT_FILE" << EOF --- title: ${{ steps.process.outputs.summary }} status: investigating severity: ${{ steps.process.outputs.severity }} affected_components: - ${{ steps.process.outputs.component }} created_at: $(date -u +"%Y-%m-%dT%H:%M:%SZ") --- ## Update - $TIMESTAMP ${{ steps.process.outputs.description }} Alert triggered by automated monitoring. EOF else # Add update to existing incident CURRENT=$(cat "$INCIDENT_FILE") FRONTMATTER=$(echo "$CURRENT" | sed -n '/^---$/,/^---$/p') BODY=$(echo "$CURRENT" | sed '1,/^---$/d' | sed '1,/^---$/d') # Update status to identified if still investigating FRONTMATTER=$(echo "$FRONTMATTER" | sed 's/status: investigating/status: identified/') cat > "$INCIDENT_FILE" << EOF $FRONTMATTER ## Update - $TIMESTAMP ${{ steps.process.outputs.description }} $BODY EOF fi else # Alert resolved if [ -f "$INCIDENT_FILE" ]; then CURRENT=$(cat "$INCIDENT_FILE") # Update frontmatter CURRENT=$(echo "$CURRENT" | sed 's/status: investigating/status: resolved/') CURRENT=$(echo "$CURRENT" | sed 's/status: identified/status: resolved/') CURRENT=$(echo "$CURRENT" | sed 's/status: monitoring/status: resolved/') # Add resolved_at if not present if ! grep -q "resolved_at:" "$INCIDENT_FILE"; then CURRENT=$(echo "$CURRENT" | sed "/^created_at:/a resolved_at: $(date -u +"%Y-%m-%dT%H:%M:%SZ")") fi # Add resolution update BODY=$(echo "$CURRENT" | sed '1,/^---$/d' | sed '1,/^---$/d') FRONTMATTER=$(echo "$CURRENT" | sed -n '/^---$/,/^---$/p') cat > "$INCIDENT_FILE" << EOF $FRONTMATTER ## Update - $TIMESTAMP Issue resolved. Services operating normally. $BODY EOF fi fi - name: Setup Go uses: actions/setup-go@v5 with: go-version: "1.24" - name: Install MinimalDoc run: go install github.com/studiowebux/minimaldoc/cmd/minimaldoc@latest - name: Rebuild Status Page run: | minimaldoc build ./docs \ --base-url "${{ vars.DOCS_BASE_URL }}" \ --output dist \ --status - name: Commit Changes run: | git config user.name "GitHub Actions" git config user.email "actions@github.com" git add docs/__status__/incidents/ git diff --staged --quiet || git commit -m "Update incident: ${{ steps.process.outputs.incident_id }}" git push - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: path: dist - name: Deploy to GitHub Pages uses: actions/deploy-pages@v4 ``` #### Component ID Mapping Map Prometheus job labels to MinimalDoc component IDs: ```yaml # prometheus/prometheus.yml scrape_configs: - job_name: "api" static_configs: - targets: ["api.example.com:9090"] labels: component: "api" # Maps to components.yaml id - job_name: "web" static_configs: - targets: ["web.example.com:9090"] labels: component: "web" - job_name: "database" static_configs: - targets: ["db.example.com:9187"] labels: component: "database" ``` #### Severity Mapping Map Prometheus severities to MinimalDoc: | Prometheus | MinimalDoc | Component Status | | ---------- | ---------- | ---------------- | | `critical` | `critical` | `major_outage` | | `major` | `major` | `partial_outage` | | `warning` | `minor` | `degraded` | #### Testing the Integration ##### Test Webhook Locally ```bash # Simulate AlertManager webhook curl -X POST \ -H "Authorization: Bearer $GITHUB_TOKEN" \ -H "Accept: application/vnd.github.v3+json" \ https://api.github.com/repos/YOUR_ORG/YOUR_REPO/dispatches \ -d '{ "event_type": "alertmanager", "client_payload": { "alerts": [{ "status": "firing", "labels": { "alertname": "TestAlert", "severity": "warning" }, "annotations": { "summary": "Test Alert", "description": "This is a test alert", "component_id": "api" } }] } }' ``` ##### Verify Workflow 1. Check Actions tab for workflow run 2. Verify incident file created 3. Check status page updated ## API Testing *Interactive API testing with Try It interface* ### API Testing MinimalDoc includes an interactive API tester for trying endpoints. #### Try It Interface Each endpoint has a "Try It" button: ``` GET /users/{id} [Try It] Parameters: id: [123 ] Headers: Authorization: [Bearer token...] [Send Request] ``` #### Features | Feature | Description | |---------|-------------| | Parameter Input | Fill path, query, header params | | Request Body | Edit JSON/form body | | Authentication | Configure auth headers | | Response Viewer | See status, headers, body | | History | Recent requests saved | #### Using Try It ##### 1. Select Endpoint Navigate to an endpoint in the API docs. ##### 2. Configure Parameters Fill required parameters: ``` Path Parameters: id: [123] Query Parameters: limit: [10] offset: [0] ``` ##### 3. Set Authentication If endpoint requires auth: ``` Authentication: [Bearer Token ▼] Token: [eyJhbG...] ``` ##### 4. Edit Request Body For POST/PUT/PATCH: ```json { "name": "John Doe", "email": "john@example.com" } ``` ##### 5. Send Request Click "Send Request" to execute. ##### 6. View Response ``` Status: 200 OK Time: 145ms Headers: Content-Type: application/json X-Request-Id: abc123 Body: { "id": 123, "name": "John Doe", "email": "john@example.com" } ``` #### Server Selection If spec defines multiple servers: ```yaml servers: - url: https://api.example.com/v1 description: Production - url: https://staging-api.example.com/v1 description: Staging - url: http://localhost:3000/v1 description: Local ``` Select in the UI: ``` Server: [Production ▼] ``` #### Request Body ##### JSON Editor Syntax-highlighted JSON editor: ```json { "name": "New User", "email": "user@example.com", "role": "admin" } ``` ##### Schema Hints Editor shows expected schema: ``` Expected: User object name (string, required) email (string, required) role (string, enum: user, admin) ``` ##### Example Generation Click "Generate Example" for sample body: ```json { "name": "string", "email": "user@example.com", "role": "user" } ``` #### Response Handling ##### Success ``` Status: 201 Created { "id": 456, "name": "New User", ... } ``` ##### Error ``` Status: 400 Bad Request { "error": "validation_error", "message": "Invalid email format", "field": "email" } ``` ##### Headers View response headers: ``` Content-Type: application/json X-RateLimit-Remaining: 99 X-Request-Id: req_abc123 ``` #### CORS Considerations Browser-based testing requires CORS headers: ```yaml # Your API must return: Access-Control-Allow-Origin: * Access-Control-Allow-Methods: GET, POST, PUT, DELETE Access-Control-Allow-Headers: Authorization, Content-Type ``` If CORS blocked: - Test against local server - Use browser extension - Test via cURL export #### Configuration ##### Disable Testing For read-only docs: ```yaml openapi: enable_testing: false ``` ##### Enable Export Only Show cURL export without Try It: ```yaml openapi: enable_testing: false enable_export: true ``` #### Export to cURL Generate cURL command for any request: ```bash curl -X GET 'https://api.example.com/v1/users/123' \ -H 'Authorization: Bearer eyJhbG...' \ -H 'Accept: application/json' ``` Copy and run in terminal. #### Export to restcli Generate restcli format: ```http GET https://api.example.com/v1/users/123 Authorization: Bearer eyJhbG... Accept: application/json ``` Compatible with [restcli](https://restcli.com). ## Scheduled Maintenance *Plan and communicate maintenance windows* ### Scheduled Maintenance Maintenance windows communicate planned downtime to users. #### File Structure Place maintenance in `__status__/maintenance/`: ``` __status__/ └── maintenance/ ├── 2025-02-01-database-upgrade.md ├── 2025-02-15-infrastructure.md └── 2025-03-01-migration.md ``` Filename format: `YYYY-MM-DD-short-description.md` #### Basic Format ```markdown --- title: Database Upgrade description: Upgrading PostgreSQL from 15 to 16 affected_components: - database - api scheduled_start: 2025-02-01T02:00:00Z scheduled_end: 2025-02-01T04:00:00Z status: scheduled --- We will be upgrading our database cluster to PostgreSQL 16. ## Expected Impact - Database will be in read-only mode for approximately 30 minutes - API responses may be slower during migration - Brief service interruption expected (< 5 minutes) ## Preparation No action required from users. All data will be preserved. ``` #### Frontmatter Fields | Field | Type | Required | Description | | --------------------- | -------- | -------- | --------------------- | | `title` | string | Yes | Maintenance title | | `description` | string | No | Brief description | | `affected_components` | []string | No | Component IDs | | `scheduled_start` | datetime | Yes | Start time (ISO 8601) | | `scheduled_end` | datetime | Yes | End time (ISO 8601) | | `status` | string | Yes | Current status | #### Status Values | Status | Description | Display | | ------------- | --------------------- | -------------- | | `scheduled` | Planned, not started | Blue calendar | | `in_progress` | Currently underway | Yellow spinner | | `completed` | Finished successfully | Green check | #### Content Structure ##### Impact Section Describe what users will experience: ```markdown ## Expected Impact - Service will be unavailable for approximately 2 hours - Users will be logged out - Scheduled jobs will be paused ``` ##### Preparation Section Tell users what to do: ```markdown ## Preparation - Save any unsaved work before the maintenance window - Download reports you need before 02:00 UTC - Plan for service unavailability ``` ##### Updates Section Add updates as maintenance progresses: ```markdown ## Updates **02:15 UTC** - Maintenance started. Database backup in progress. **02:45 UTC** - Backup complete. Starting migration. **03:30 UTC** - Migration complete. Running verification. **03:45 UTC** - Verification passed. Bringing services back online. **04:00 UTC** - Maintenance complete. All services operational. ``` #### Examples ##### Scheduled ```markdown --- title: Infrastructure Update description: Updating server infrastructure affected_components: - api - web scheduled_start: 2025-02-15T03:00:00Z scheduled_end: 2025-02-15T05:00:00Z status: scheduled --- We will be updating our server infrastructure to improve performance and reliability. ## Expected Impact - Brief interruptions possible (< 1 minute each) - No data loss expected - Service will remain mostly available ## Preparation No action required. ``` ##### In Progress ```markdown --- title: Database Migration description: Migrating to new database cluster affected_components: - database scheduled_start: 2025-02-01T02:00:00Z scheduled_end: 2025-02-01T06:00:00Z status: in_progress --- Database migration is currently in progress. ## Expected Impact - Read-only mode until migration completes - Write operations will fail temporarily ## Updates **02:00 UTC** - Maintenance started. **02:30 UTC** - Data export complete. Starting import to new cluster. **04:00 UTC** - Import 75% complete. On schedule. ``` ##### Completed ```markdown --- title: Security Patch description: Applying critical security patches affected_components: - api - web scheduled_start: 2025-01-20T04:00:00Z scheduled_end: 2025-01-20T04:30:00Z status: completed --- Security patches have been successfully applied. ## Summary - All patches applied successfully - No service interruption occurred - Systems verified and operational ## Updates **04:00 UTC** - Started applying patches. **04:20 UTC** - Patches applied. Running verification. **04:25 UTC** - Verification complete. All systems operational. ``` #### Display ##### Dashboard Upcoming maintenance shown in dedicated section: ``` ┌─────────────────────────────────────────────────┐ │ Scheduled Maintenance │ ├─────────────────────────────────────────────────┤ │ Database Upgrade │ │ Feb 1, 02:00 - 04:00 UTC │ │ Affects: Database, API │ ├─────────────────────────────────────────────────┤ │ Infrastructure Update │ │ Feb 15, 03:00 - 05:00 UTC │ │ Affects: API, Web │ └─────────────────────────────────────────────────┘ ``` ##### Component Status During maintenance, affected components show: ``` API Under Maintenance Database Under Maintenance Web Operational ``` ##### RSS Feed Maintenance announcements included in feed. #### Timezone All times in ISO 8601 with timezone: ```yaml # UTC scheduled_start: 2025-02-01T02:00:00Z # With offset scheduled_start: 2025-02-01T02:00:00+00:00 # Local time (converted to UTC) scheduled_start: 2025-01-31T21:00:00-05:00 ``` Display shows user's local timezone. ## Code Highlighting *Syntax highlighting for 100+ programming languages* ### Code Highlighting MinimalDoc uses Chroma for syntax highlighting, supporting 100+ languages. #### Basic Usage Wrap code in triple backticks with language identifier: ````markdown ```go package main import "fmt" func main() { fmt.Println("Hello, World!") } ``` ```` Renders as: ```go package main import "fmt" func main() { fmt.Println("Hello, World!") } ``` #### Supported Languages ##### Web | Language | Identifier | |----------|------------| | HTML | `html` | | CSS | `css` | | JavaScript | `javascript`, `js` | | TypeScript | `typescript`, `ts` | | JSON | `json` | | XML | `xml` | | YAML | `yaml` | | TOML | `toml` | ##### Systems | Language | Identifier | |----------|------------| | Go | `go` | | Rust | `rust` | | C | `c` | | C++ | `cpp`, `c++` | | Swift | `swift` | | Objective-C | `objectivec` | ##### Scripting | Language | Identifier | |----------|------------| | Python | `python`, `py` | | Ruby | `ruby`, `rb` | | PHP | `php` | | Perl | `perl` | | Lua | `lua` | ##### Shell | Language | Identifier | |----------|------------| | Bash | `bash`, `sh` | | PowerShell | `powershell` | | Fish | `fish` | | Zsh | `zsh` | ##### Data | Language | Identifier | |----------|------------| | SQL | `sql` | | GraphQL | `graphql` | | Protobuf | `protobuf` | ##### Other | Language | Identifier | |----------|------------| | Markdown | `markdown`, `md` | | Diff | `diff` | | Makefile | `makefile` | | Dockerfile | `dockerfile` | | Terraform | `hcl`, `terraform` | #### Examples ##### JavaScript ```javascript const greet = (name) => { return `Hello, ${name}!`; }; export default greet; ``` ##### Python ```python def fibonacci(n: int) -> list[int]: if n <= 0: return [] sequence = [0, 1] while len(sequence) < n: sequence.append(sequence[-1] + sequence[-2]) return sequence[:n] ``` ##### Rust ```rust fn main() { let numbers: Vec<i32> = (1..=10).collect(); let sum: i32 = numbers.iter().sum(); println!("Sum: {}", sum); } ``` ##### SQL ```sql SELECT u.name, COUNT(o.id) as order_count FROM users u LEFT JOIN orders o ON u.id = o.user_id WHERE u.created_at > '2025-01-01' GROUP BY u.id HAVING order_count > 5 ORDER BY order_count DESC; ``` ##### YAML ```yaml server: host: localhost port: 8080 tls: enabled: true cert: /path/to/cert.pem key: /path/to/key.pem ``` ##### Bash ```bash #!/bin/bash set -euo pipefail for file in *.md; do echo "Processing: $file" minimaldoc build "$file" done ``` ##### Diff ```diff - const oldValue = "deprecated"; + const newValue = "updated"; function process() { - return oldValue; + return newValue; } ``` #### Inline Code Use single backticks for inline code: ```markdown Use the `build` command to generate HTML. ``` Renders as: Use the `build` command to generate HTML. #### No Language Omit language for plain text: ````markdown ``` Plain text without highlighting ``` ```` ``` Plain text without highlighting ``` #### Escaping To show code block syntax, use four backticks: `````markdown ````markdown ```go // This shows the code block syntax ``` ```` ````` #### Theme Integration Code blocks adapt to light/dark mode: | Mode | Background | Text | |------|------------|------| | Light | `#f5f5f5` | Dark syntax colors | | Dark | `#0d1117` | Light syntax colors | ## Roadmap Pages *Add a visual roadmap to your documentation site* ### Roadmap Pages Display a public roadmap with board or timeline layout, version badges, and tag filtering. #### Configuration ```yaml roadmap: enabled: true title: Roadmap description: What we're building next layout: board show_versions: true path: roadmap columns: - id: planned label: Planned - id: in_progress label: In Progress - id: shipped label: Shipped items: - title: Dark mode description: System-aware theme switching with manual override status: shipped version: v1.0 tags: [ui, theme] shipped_date: "2025-01-15" changelog_url: "/changelog/#v1.0" - title: Plugin system description: Extensible plugin architecture for custom page types status: planned version: v2.0 tags: [architecture] ``` #### Layouts ##### Board Kanban-style columns. Each column maps to a `columns[].id`. ```yaml layout: board columns: - id: planned label: Planned - id: in_progress label: In Progress - id: shipped label: Shipped ``` Items appear in the column matching their `status` field. ##### Timeline Chronological view grouped by version. Enable with: ```yaml layout: timeline show_versions: true ``` #### Item Fields | Field | Type | Required | Description | |-------|------|----------|-------------| | `title` | string | yes | Item title | | `description` | string | no | Short description | | `status` | string | yes | Must match a `columns[].id` | | `version` | string | no | Version badge (e.g., `v1.0`) | | `tags` | []string | no | Filterable tags | | `shipped_date` | string | no | Ship date (YYYY-MM-DD), shown for shipped items | | `changelog_url` | string | no | Link to changelog entry | #### Tag Filtering Tags are rendered as clickable filters above the board. Clicking a tag shows only items with that tag. Tags are extracted automatically from all items. #### Linking to Changelog Use `changelog_url` to link shipped items to their release notes: ```yaml - title: Status pages status: shipped version: v1.1 changelog_url: "/changelog/#v1.1" ``` #### Custom Columns Columns are fully configurable. Common patterns: **Simple three-column:** ```yaml columns: - id: planned label: Planned - id: in_progress label: In Progress - id: shipped label: Shipped ``` **With backlog:** ```yaml columns: - id: backlog label: Backlog - id: next label: Up Next - id: in_progress label: Building - id: shipped label: Shipped ``` #### Output The roadmap page is generated at `/<path>/index.html` (default: `/roadmap/index.html`). A link appears automatically in the site navigation. ## Authentication *Configure API authentication for testing* ### Authentication MinimalDoc supports OpenAPI security schemes for API testing. #### Supported Methods | Method | Type | Description | |--------|------|-------------| | Bearer Token | `http: bearer` | JWT or opaque tokens | | API Key | `apiKey` | Header or query parameter | | OAuth 2.0 | `oauth2` | Authorization Code flow | | Basic Auth | `http: basic` | Username/password | #### Bearer Token ##### Spec Definition ```yaml components: securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT security: - bearerAuth: [] ``` ##### Usage in UI ``` Authentication: Bearer Token Token: [eyJhbGciOiJIUzI1NiIs...] ``` Generated header: ``` Authorization: Bearer eyJhbGciOiJIUzI1NiIs... ``` #### API Key ##### Header-Based ```yaml components: securitySchemes: apiKeyAuth: type: apiKey in: header name: X-API-Key security: - apiKeyAuth: [] ``` Usage: ``` Authentication: API Key (Header) X-API-Key: [sk_live_abc123...] ``` ##### Query Parameter ```yaml components: securitySchemes: apiKeyQuery: type: apiKey in: query name: api_key ``` Usage: ``` Authentication: API Key (Query) api_key: [sk_live_abc123...] ``` Added to URL: ``` GET /users?api_key=sk_live_abc123 ``` #### OAuth 2.0 ##### Authorization Code Flow ```yaml components: securitySchemes: oauth2: type: oauth2 flows: authorizationCode: authorizationUrl: https://auth.example.com/authorize tokenUrl: https://auth.example.com/token scopes: read: Read access write: Write access ``` ##### Usage in UI 1. Click "Authorize" 2. Redirect to auth provider 3. Grant permissions 4. Token stored automatically ``` Authentication: OAuth 2.0 Status: Authorized Scopes: read, write [Revoke] ``` ##### Token Refresh OAuth tokens refresh automatically when expired. #### Basic Auth ```yaml components: securitySchemes: basicAuth: type: http scheme: basic ``` Usage: ``` Authentication: Basic Username: [admin] Password: [••••••••] ``` Generated header: ``` Authorization: Basic YWRtaW46cGFzc3dvcmQ= ``` #### Per-Endpoint Security Override global security: ```yaml paths: /public: get: security: [] # No auth required summary: Public endpoint /admin: get: security: - bearerAuth: [] - apiKeyAuth: [] # Either method works summary: Admin endpoint ``` #### Multiple Security Options ```yaml security: - bearerAuth: [] - apiKeyAuth: [] ``` UI shows dropdown: ``` Authentication: [Bearer Token ▼] Bearer Token API Key ``` #### Combined Security Require multiple auth methods: ```yaml security: - bearerAuth: [] apiKeyAuth: [] # Both required ``` #### Token Persistence ##### Session Storage Tokens stored in browser session: - Cleared on tab close - Isolated per origin ##### Local Storage Enable persistent tokens: ``` [x] Remember authentication ``` Tokens persist across sessions. #### Configuration ##### Disable Testing Hides auth configuration: ```yaml openapi: enable_testing: false ``` ##### Documentation Only Show security requirements without testing: ```yaml openapi: enable_testing: false enable_code_samples: true # Shows auth in samples ``` ## Uptime Tracking *Track service availability with uptime grid and SLA display* ### Uptime Tracking Track service availability with uptime grid and SLA metrics. #### Overview Uptime tracking provides: - 90-day uptime grid (horizontal colored squares) - SLA percentage display - Period breakdowns (7d, 30d, 90d) - Per-component tracking #### Data Sources Two modes for uptime data: | Mode | Source | Use Case | | ----------- | --------------------------- | ------------------------- | | `incidents` | Derived from incident files | Static sites, no backend | | `api` | External API endpoint | Real-time monitoring data | #### Incidents Mode Calculate uptime from incident history at build time. ##### Configuration ```yaml # components.yaml - id: api name: API uptime: mode: incidents sla_target: 99.9 period_days: 90 ``` ##### How It Works 1. Scan incidents where `affected_components` includes this component 2. For each day, calculate downtime from incident timestamps 3. Determine daily status based on downtime 4. Calculate uptime percentage ##### Calculation ``` Daily Uptime = (1440 - downtime_minutes) / 1440 * 100 Period Uptime = Average of daily uptimes ``` Where 1440 = minutes in a day. ##### Downtime Mapping | Incident Duration | Daily Status | | ------------------ | -------------- | | 0 minutes | Operational | | 1-30 minutes | Degraded | | 31-240 minutes | Partial Outage | | 241+ minutes | Major Outage | | Maintenance window | Maintenance | #### API Mode Fetch uptime data from external monitoring service. ##### Configuration ```yaml # components.yaml - id: api name: API url: https://api.example.com uptime: mode: api endpoint: /uptime sla_target: 99.9 ``` ##### API Response Format Your endpoint must return: ```json { "component_id": "api", "period_days": 90, "uptime_percent": 99.95, "history": [ { "date": "2025-01-28", "status": "operational", "downtime_minutes": 0 }, { "date": "2025-01-27", "status": "partial_outage", "downtime_minutes": 45 } ], "sla": { "target": 99.9, "current_7d": 100.0, "current_30d": 99.95, "current_90d": 99.92 } } ``` ##### Fields | Field | Type | Description | | ---------------- | ------ | -------------------- | | `component_id` | string | Component identifier | | `period_days` | int | History period | | `uptime_percent` | float | Overall uptime | | `history` | array | Daily status entries | | `sla` | object | SLA metrics | ##### History Entry | Field | Type | Description | | ------------------ | ------ | ------------------- | | `date` | string | Date (YYYY-MM-DD) | | `status` | string | Daily status | | `downtime_minutes` | int | Minutes of downtime | ##### SLA Object | Field | Type | Description | | ------------- | ----- | --------------------- | | `target` | float | Target SLA percentage | | `current_7d` | float | Last 7 days uptime | | `current_30d` | float | Last 30 days uptime | | `current_90d` | float | Last 90 days uptime | #### Uptime Grid A horizontal row of colored squares representing the last 90 days. Each square is 10x10px and shows the status for that day. Hover over any square to see the date, status, and downtime minutes. ##### Colors | Status | Light Mode | Dark Mode | | -------------- | ---------- | ----------- | | Operational | Green | Dark Green | | Degraded | Yellow | Dark Yellow | | Partial Outage | Orange | Dark Orange | | Major Outage | Red | Dark Red | | Maintenance | Blue | Dark Blue | #### SLA Display Shows uptime percentage with period breakdowns (7d, 30d, 90d) and target comparison. ##### Target Comparison | Condition | Display | | ----------------- | ------------------ | | Current >= Target | Green "Met" | | Current < Target | Red "Below Target" | #### Configuration Options ```yaml uptime: mode: incidents # or "api" endpoint: /uptime # API mode only sla_target: 99.9 # Target percentage period_days: 90 # Tracking period ``` | Option | Default | Description | | ------------- | ----------- | ----------------- | | `mode` | `incidents` | Data source mode | | `endpoint` | `/uptime` | API endpoint path | | `sla_target` | `99.9` | Target uptime % | | `period_days` | `90` | Days of history | #### Examples ##### Basic Incidents Mode ```yaml - id: api name: API uptime: mode: incidents sla_target: 99.9 ``` ##### API Mode with Custom Endpoint ```yaml - id: api name: API url: https://api.example.com uptime: mode: api endpoint: /metrics/uptime sla_target: 99.99 period_days: 30 ``` ##### High-Availability Service ```yaml - id: database name: Database uptime: mode: incidents sla_target: 99.99 # Four nines period_days: 90 ``` #### Build Output Uptime data included in `status.json`: ```json { "components": [ { "id": "api", "name": "API", "uptime": { "mode": "incidents", "period_days": 90, "uptime_percent": 99.95, "history": [...], "sla": { "target": 99.9, "current_7d": 100.0, "current_30d": 99.97, "current_90d": 99.95 } } } ] } ``` ## SEO *Search engine optimization features including sitemap, meta tags, and Open Graph* ### SEO MinimalDoc generates SEO-friendly output automatically. #### Sitemap A `sitemap.xml` is generated during build: ```xml <?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>https://example.com/docs/</loc> <lastmod>2025-01-15</lastmod> </url> <url> <loc>https://example.com/docs/getting-started/</loc> <lastmod>2025-01-14</lastmod> </url> </urlset> ``` Submit to search engines: - Google Search Console - Bing Webmaster Tools #### Meta Tags ##### Title Generated from frontmatter: ```yaml --- title: Installation Guide --- ``` Produces: ```html <title>Installation Guide - My Docs ``` Override with SEO title: ```yaml --- title: Installation Guide seo: title: How to Install MyProject - Complete Guide --- ``` ##### Description ```yaml --- description: Step-by-step installation instructions --- ``` Produces: ```html ``` ##### Keywords ```yaml --- seo: keywords: - installation - setup - getting started --- ``` Produces: ```html ``` #### Open Graph For social media sharing: ```yaml --- title: MinimalDoc description: Static site generator for documentation seo: image: /images/social-card.png --- ``` Produces: ```html ``` ##### Twitter Cards Also generates Twitter Card meta: ```html ``` #### Canonical URLs Specify canonical URL: ```yaml --- seo: canonical: https://example.com/docs/installation --- ``` Produces: ```html ``` #### Robots Control ##### Noindex Hide page from search engines: ```yaml --- seo: noindex: true --- ``` Produces: ```html ``` ##### Nofollow Prevent following links: ```yaml --- seo: nofollow: true --- ``` Both: ```yaml --- seo: noindex: true nofollow: true --- ``` Produces: ```html ``` #### Base URL Configure in `config.yaml`: ```yaml base_url: https://docs.example.com ``` Used for: - Sitemap URLs - Canonical URLs - Open Graph URLs - Absolute links #### Clean URLs Enable for SEO-friendly URLs: ```yaml clean_urls: true ``` | Setting | URL | |---------|-----| | `false` | `/docs/installation.html` | | `true` | `/docs/installation/` | ## Portfolio *Project showcase with filterable tags and individual project pages* ### Portfolio Display a project showcase with filterable tags, images, and individual project pages. #### Configuration ```yaml portfolio: enabled: true title: Projects description: Sites built with our tool path: projects ``` | Field | Type | Default | Description | |-------|------|---------|-------------| | `enabled` | bool | `false` | Enable portfolio page | | `title` | string | `"Projects"` | Page title | | `description` | string | `""` | Page description | | `path` | string | `"projects"` | Output path | #### Project Files Create markdown files in `__portfolio__/` directory: ``` docs/ __portfolio__/ my-project.md another-project.md ``` Each file uses frontmatter to define the project: ```yaml --- title: My Project description: A brief description of the project image: /images/projects/my-project.png url: https://example.com tags: - documentation - open-source order: 1 --- Detailed project description in markdown. ``` ##### Frontmatter Fields | Field | Type | Required | Description | |-------|------|----------|-------------| | `title` | string | yes | Project name | | `description` | string | no | Short description shown on the listing | | `image` | string | no | Preview image URL | | `url` | string | no | External project link | | `tags` | []string | no | Filterable tags | | `order` | int | no | Sort order (lower = first) | #### Tag Filtering Tags are rendered as clickable filters on the portfolio listing page. Clicking a tag shows only projects with that tag. #### Output - Listing page: `//index.html` - Individual project: `///index.html` ## Code Samples *Auto-generated code examples for API endpoints* ### Code Samples MinimalDoc generates code samples for every endpoint. #### Supported Languages | Language | Library | | ---------- | ---------- | | cURL | Native | | JavaScript | Fetch API | | Python | requests | | Go | net/http | | Swift | URLSession | #### Configuration Enable code samples: ```yaml openapi: enable_code_samples: true ``` Disable: ```yaml openapi: enable_code_samples: false ``` #### Sample Output ##### cURL ```bash curl -X POST 'https://api.example.com/v1/users' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -d '{ "name": "John Doe", "email": "john@example.com" }' ``` ##### JavaScript ```javascript const response = await fetch("https://api.example.com/v1/users", { method: "POST", headers: { "Content-Type": "application/json", Authorization: "Bearer YOUR_TOKEN", }, body: JSON.stringify({ name: "John Doe", email: "john@example.com", }), }); const data = await response.json(); ``` ##### Python ```python import requests response = requests.post( 'https://api.example.com/v1/users', headers={ 'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_TOKEN' }, json={ 'name': 'John Doe', 'email': 'john@example.com' } ) data = response.json() ``` ##### Go ```go package main import ( "bytes" "encoding/json" "net/http" ) func main() { body := map[string]string{ "name": "John Doe", "email": "john@example.com", } jsonBody, _ := json.Marshal(body) req, _ := http.NewRequest("POST", "https://api.example.com/v1/users", bytes.NewBuffer(jsonBody)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer YOUR_TOKEN") client := &http.Client{} resp, _ := client.Do(req) defer resp.Body.Close() } ``` ##### Swift ```swift import Foundation let url = URL(string: "https://api.example.com/v1/users")! var request = URLRequest(url: url) request.httpMethod = "POST" request.setValue("application/json", forHTTPHeaderField: "Content-Type") request.setValue("Bearer YOUR_TOKEN", forHTTPHeaderField: "Authorization") let body: [String: Any] = [ "name": "John Doe", "email": "john@example.com" ] request.httpBody = try? JSONSerialization.data(withJSONObject: body) let task = URLSession.shared.dataTask(with: request) { data, response, error in // Handle response } task.resume() ``` #### Features ##### Path Parameters Substituted in URL: ```bash # Spec: GET /users/{id} curl -X GET 'https://api.example.com/v1/users/123' ``` ##### Query Parameters Appended to URL: ```bash # Spec: GET /users?limit=10&offset=0 curl -X GET 'https://api.example.com/v1/users?limit=10&offset=0' ``` ##### Request Body Generated from schema: ```yaml # Spec schema User: type: object properties: name: type: string email: type: string format: email ``` Produces: ```json { "name": "string", "email": "user@example.com" } ``` ##### Authentication Included based on security scheme: ```bash # Bearer -H 'Authorization: Bearer YOUR_TOKEN' # API Key -H 'X-API-Key: YOUR_API_KEY' # Basic -H 'Authorization: Basic base64(user:pass)' ``` #### Example Generation ##### From Schema ```yaml components: schemas: CreateUserRequest: type: object required: - name - email properties: name: type: string example: "John Doe" email: type: string format: email example: "john@example.com" age: type: integer minimum: 0 maximum: 150 ``` Generated example: ```json { "name": "John Doe", "email": "john@example.com", "age": 25 } ``` ##### Precedence 1. `example` field (exact value) 2. `examples` field (first example) 3. Generated from constraints #### Copy to Clipboard Each sample has a copy button: ``` [curl] [JavaScript] [Python] [Go] [Swift] ┌─────────────────────────────────────┐ │ curl -X GET 'https://...' │ │ [Copy] │ └─────────────────────────────────────┘ ``` #### Customization ##### Server URL Samples use selected server: ```yaml servers: - url: https://api.example.com/v1 description: Production - url: http://localhost:3000/v1 description: Local ``` ##### Content Type Based on request body: ```yaml requestBody: content: application/json: # Uses JSON schema: $ref: "#/components/schemas/User" multipart/form-data: # Uses form data schema: type: object properties: file: type: string format: binary ``` ## Health Checks *Static and real-time approaches to service monitoring* ### Health Checks Two approaches for monitoring service health in MinimalDoc. #### Approach Comparison | Aspect | Static (CI/CD) | Real-Time (Client) | |--------|----------------|-------------------| | Updates | On pipeline trigger | Every page load | | Server load | Zero | Every visitor polls endpoints | | Latency display | No | Yes | | External dependency | Prometheus, Datadog, etc. | CORS-enabled endpoints | | Cost | Build/deploy only | None | | Accuracy | Delayed (pipeline latency) | Live | #### Approach 1: Static (CI/CD Driven) Status updates only when your CI/CD pipeline runs. External monitoring triggers the update. ##### How It Works ``` Prometheus detects issue → Webhook triggers pipeline → Pipeline edits incident file → Site rebuilds → Static files uploaded ``` ##### Configuration No `health_endpoint` needed. Set status manually or via automation: ```yaml # components.yaml - id: api name: API status: operational # Updated by CI/CD ``` ##### Automation Example GitHub Actions workflow triggered by external monitoring: ```yaml name: Update Status on: repository_dispatch: types: [status-change] jobs: update: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Update component status run: | yq -i '.[] | select(.id == "${{ github.event.client_payload.component }}") .status = "${{ github.event.client_payload.status }}"' \ docs/__status__/components.yaml - name: Create incident if needed if: github.event.client_payload.status != 'operational' run: | cat > docs/__status__/incidents/$(date +%Y-%m-%d)-${{ github.event.client_payload.component }}.md << EOF --- title: ${{ github.event.client_payload.title }} status: investigating severity: ${{ github.event.client_payload.severity }} affected_components: - ${{ github.event.client_payload.component }} created_at: $(date -u +%Y-%m-%dT%H:%M:%SZ) --- Investigating issue detected by monitoring. EOF - name: Build and deploy run: | minimaldoc build # deploy to hosting... ``` ##### Benefits - No client-side requests to your services - Works with any monitoring stack (Prometheus, Datadog, Pingdom, etc.) - Zero runtime cost after build - Full control over when status changes ##### Trade-offs - Status updates have pipeline latency (seconds to minutes) - Requires external monitoring infrastructure - No real-time latency display --- #### Approach 2: Real-Time (Client Polling) Browser polls endpoints directly for live status and latency. ##### How It Works 1. Browser loads status page 2. JavaScript polls each configured endpoint 3. Status and latency displayed 4. Countdown shows time to next check 5. Repeat at configured interval ##### Configuration ```yaml # components.yaml - id: api name: API url: https://api.example.com health_endpoint: /health health_interval: 30 ``` | Field | Type | Description | |-------|------|-------------| | `url` | string | Base service URL | | `health_endpoint` | string | Health check path | | `health_interval` | int | Seconds between checks | ##### Benefits - Live latency display - Immediate status updates - No external monitoring needed - Simple setup ##### Trade-offs - Every visitor polls your endpoints - Requires CORS headers on health endpoints - Can increase load on services - Browser must be open to see updates --- #### Real-Time Details ##### Display ``` ┌─────────────────────────────────────────────────┐ │ API │ │ https://api.example.com │ │ │ │ Status: ● Healthy Latency: 24ms │ │ Last check: 10s ago Next: 20s │ └─────────────────────────────────────────────────┘ ``` #### Configuration ```yaml # components.yaml - id: api name: API url: https://api.example.com health_endpoint: /health health_interval: 30 ``` | Field | Type | Description | | ----------------- | ------ | ---------------------- | | `url` | string | Base service URL | | `health_endpoint` | string | Health check path | | `health_interval` | int | Seconds between checks | #### How It Works 1. Browser loads status page 2. JavaScript polls each configured endpoint 3. Status and latency displayed 4. Countdown shows time to next check 5. Repeat at configured interval #### Display ``` ┌─────────────────────────────────────────────────┐ │ API │ │ https://api.example.com │ │ │ │ Status: ● Healthy Latency: 24ms │ │ Last check: 10s ago Next: 20s │ └─────────────────────────────────────────────────┘ ``` ##### Status Indicators | Status | Indicator | Condition | | --------- | --------------- | ------------------- | | Healthy | Green dot | 2xx response | | Degraded | Yellow dot | Slow response (>1s) | | Unhealthy | Red dot | Non-2xx or timeout | | Checking | Pulse animation | Request in progress | ##### Latency Display | Range | Display | | --------- | ------- | | < 100ms | Green | | 100-500ms | Yellow | | 500ms-1s | Orange | | > 1s | Red | #### Health Endpoint Your service should expose a health endpoint: ##### Simple Response ```json GET /health 200 OK { "status": "ok" } ``` ##### Detailed Response ```json GET /health 200 OK { "status": "ok", "version": "1.2.3", "uptime": 86400, "checks": { "database": "ok", "cache": "ok", "queue": "ok" } } ``` ##### Unhealthy Response ```json GET /health 503 Service Unavailable { "status": "unhealthy", "checks": { "database": "error", "cache": "ok" } } ``` #### Status Determination | Response | Status | | ------------- | ------------------ | | 200-299 | Healthy | | 300-399 | Healthy (redirect) | | 400-499 | Unhealthy | | 500-599 | Unhealthy | | Timeout | Unhealthy | | Network error | Unhealthy | #### Configuration Examples ##### Basic ```yaml - id: api name: API url: https://api.example.com health_endpoint: /health health_interval: 30 ``` ##### Frequent Checks ```yaml - id: critical-service name: Critical Service url: https://critical.example.com health_endpoint: /health health_interval: 10 # Every 10 seconds ``` ##### Custom Endpoint ```yaml - id: legacy-service name: Legacy Service url: https://legacy.example.com health_endpoint: /api/v1/status health_interval: 60 ``` ##### Multiple Services ```yaml - id: api name: API url: https://api.example.com health_endpoint: /health health_interval: 30 - id: web name: Web App url: https://app.example.com health_endpoint: /health health_interval: 30 - id: cdn name: CDN url: https://cdn.example.com health_endpoint: /health health_interval: 60 ``` #### CORS Requirements Health endpoints must allow cross-origin requests: ``` Access-Control-Allow-Origin: * Access-Control-Allow-Methods: GET, HEAD, OPTIONS ``` #### Choosing an Approach | Use Case | Recommended | |----------|-------------| | High traffic status page | Static (CI/CD) | | Internal tools, low traffic | Real-Time (Client) | | External services you don't control | Static (CI/CD) | | Services with CORS-enabled health endpoints | Either | | No monitoring infrastructure | Real-Time (Client) | #### Static-Only Components Components without health configuration use the static approach: ```yaml - id: external-service name: External Service status: operational # Updated by CI/CD only ``` No live polling, no latency display. Status changes via pipeline. #### Fallback Behavior If health check fails: 1. Component shows configured static status 2. Error indicator displayed 3. Retry at next interval #### JSON Output Health configuration included in `status.json`: ```json { "components": [ { "id": "api", "name": "API", "url": "https://api.example.com", "health_endpoint": "/health", "health_interval": 30 } ] } ``` External tools can use this for their own monitoring. ## LLMs.txt *Generate LLM-friendly documentation for AI assistants* ### LLMs.txt MinimalDoc generates LLM-friendly output for AI assistants. #### Generated Files | File | Purpose | |------|---------| | `llms.txt` | Index with links to individual pages | | `llms-full.txt` | All documentation in a single file | | `*.md` | Companion markdown files alongside HTML | #### Purpose LLM-friendly format enables: - AI chatbots to answer questions about your project - IDE assistants (Copilot, Cursor) to understand your docs - Custom AI integrations - Documentation search tools #### Configuration Enabled by default: ```yaml enable_llms: true ``` Disable: ```yaml enable_llms: false ``` Or via CLI: ```bash minimaldoc build --llms=false ``` #### File Location Generated at output root: ``` public/ ├── index.html ├── llms.txt # Index with page links ├── llms-full.txt # All content in one file ├── getting-started/ │ ├── installation.html │ └── installation.md # Companion markdown ├── sitemap.xml └── ... ``` #### llms.txt Format Index file with links to documentation: ```markdown # Site Title > Site description ## Documentation - [Installation](/getting-started/installation.md): Install MinimalDoc - [Quick Start](/getting-started/quick-start.md): Create your first site ## Optional - [Complete Documentation](/llms-full.txt): All documentation in a single file ``` #### llms-full.txt Format All content concatenated: ```markdown # Site Title > Site description --- # Installation Full page content here... --- # Quick Start Full page content here... ``` #### Companion .md Files Each HTML page gets a markdown companion for direct LLM access: ``` /getting-started/installation.html → /getting-started/installation.md ``` #### Use Cases ##### ChatGPT / Claude Upload `llms.txt` as context: ``` Based on the attached documentation, how do I configure dark mode? ``` ##### GitHub Copilot Reference in your codebase: ```typescript // See llms.txt for MinimalDoc configuration options const config = { // ... }; ``` ##### Custom AI Integration ```python import openai with open('llms.txt', 'r') as f: docs = f.read() response = openai.ChatCompletion.create( model="gpt-4", messages=[ {"role": "system", "content": f"Documentation:\n{docs}"}, {"role": "user", "content": "How do I add a new page?"} ] ) ``` ##### RAG (Retrieval Augmented Generation) Split and embed for vector search: ```python from langchain.text_splitter import MarkdownTextSplitter from langchain.vectorstores import Chroma splitter = MarkdownTextSplitter(chunk_size=1000) chunks = splitter.split_text(docs) vectorstore = Chroma.from_texts(chunks, embeddings) ``` #### Optimization ##### Exclude Content Hidden pages are excluded: ```yaml --- title: Internal Notes hidden: true --- ``` ##### Prioritize Content Structure pages so important content appears early: - Clear, concise introductions - Key information first - Examples after explanations ##### Token Efficiency LLM context windows are limited. Keep documentation: - Focused and relevant - Free of redundancy - Well-organized #### File Size `llms-full.txt` size depends on documentation volume. Most LLMs handle 100KB+ easily. #### Comparison | Format | Use Case | |--------|----------| | `llms.txt` | Index with links to pages | | `llms-full.txt` | All content for full context | | `*.md` companions | Individual page access | | `sitemap.xml` | Search engines | | `search-index.json` | Client-side search | ## Knowledge Base *Categorized help articles with search and structured navigation* ### Knowledge Base A categorized article system with search, icons, and structured navigation. #### Configuration ```yaml knowledgebase: enabled: true title: Knowledge Base description: Find answers and guides path: kb search: enabled: true placeholder: "Search articles..." categories: getting-started: name: Getting Started description: Installation and setup icon: rocket order: 1 features: name: Features description: Search, themes, code blocks icon: code order: 2 troubleshooting: name: Troubleshooting description: Common issues and solutions icon: wrench order: 3 ``` #### Article Files Create markdown files in `__kb__//` directories: ``` docs/ __kb__/ getting-started/ 01-installation.md 02-configuration.md features/ 01-search.md 02-dark-mode.md troubleshooting/ 01-build-errors.md ``` The directory name must match a key in the `categories` map. ##### Article Frontmatter ```yaml --- title: How to Configure Search description: Enable and customize client-side search tags: - search - configuration order: 1 --- ``` | Field | Type | Required | Description | |-------|------|----------|-------------| | `title` | string | yes | Article title | | `description` | string | no | Short description shown on listing | | `tags` | []string | no | Article tags for search | | `order` | int | no | Sort order within category | #### Category Configuration | Field | Type | Description | |-------|------|-------------| | `name` | string | Display name | | `description` | string | Category description shown on landing | | `icon` | string | Icon identifier (rocket, code, wrench, book, etc.) | | `order` | int | Sort order on landing page | #### KB Search When `search.enabled` is true, a search input appears on the KB landing page. It searches across all article titles, descriptions, and tags. #### Output - Landing page: `//index.html` - Category page: `///index.html` - Article page: `///
.html` ## Schemas *Browse and explore API data models* ### Schemas The Schemas tab provides a dedicated view for exploring API data models. #### Accessing Schemas Click the "Schemas" tab in API documentation: ``` [Path] [Tag] [Flat] [Schemas] ``` #### Schema List All schemas from `components/schemas` displayed alphabetically: ``` Schemas (12) ├── CreateUserRequest ├── Error ├── Order ├── OrderItem ├── PaginatedResponse ├── Product ├── UpdateUserRequest ├── User └── ... ``` #### Schema Details Click a schema to expand: ``` User (object) │ ├── id │ type: integer │ format: int64 │ readOnly: true │ ├── name (required) │ type: string │ minLength: 1 │ maxLength: 100 │ ├── email (required) │ type: string │ format: email │ ├── role │ type: string │ enum: [user, admin, moderator] │ default: user │ ├── created_at │ type: string │ format: date-time │ readOnly: true │ └── profile $ref: #/components/schemas/UserProfile ``` #### Type Indicators | Type | Display | | --------- | --------------------------- | | `object` | Object icon, expandable | | `array` | Array icon, shows item type | | `string` | String icon | | `integer` | Number icon | | `boolean` | Boolean icon | | `$ref` | Reference link | #### Property Information ##### Constraints ``` age type: integer minimum: 0 maximum: 150 description: User's age in years ``` ##### Formats ``` email type: string format: email created_at type: string format: date-time id type: string format: uuid ``` ##### Enums ``` status type: string enum: - pending - active - suspended default: pending ``` ##### Required Fields Required fields marked with indicator: ``` ├── name (required) ├── email (required) ├── age ``` #### Nested Schemas Expand nested objects inline: ``` User (object) └── profile └── UserProfile (object) ├── bio │ type: string ├── avatar_url │ type: string │ format: uri └── social_links └── array of SocialLink ├── platform └── url ``` #### Arrays Array schemas show item type: ``` tags type: array items: type: string minItems: 1 maxItems: 10 uniqueItems: true ``` #### References Click `$ref` to navigate: ``` order_items type: array items: $ref: #/components/schemas/OrderItem [→] ``` #### JSON Examples Auto-generated examples from schema: ```json // User { "id": 12345, "name": "John Doe", "email": "john@example.com", "role": "user", "created_at": "2025-01-15T10:30:00Z", "profile": { "bio": "Software developer", "avatar_url": "https://example.com/avatar.jpg", "social_links": [ { "platform": "twitter", "url": "https://twitter.com/johndoe" } ] } } ``` #### Search Filter schemas by name: ``` Search: [user ] Results: CreateUserRequest UpdateUserRequest User UserProfile ``` #### Composition ##### allOf (Inheritance) ```yaml AdminUser: allOf: - $ref: "#/components/schemas/User" - type: object properties: permissions: type: array items: type: string ``` Displayed as: ``` AdminUser (object) extends: User └── permissions type: array ``` ##### oneOf (Union) ```yaml Response: oneOf: - $ref: "#/components/schemas/SuccessResponse" - $ref: "#/components/schemas/ErrorResponse" ``` Displayed as: ``` Response (oneOf) ├── SuccessResponse └── ErrorResponse ``` ##### anyOf ```yaml Value: anyOf: - type: string - type: integer - type: boolean ``` Displayed as: ``` Value (anyOf) ├── string ├── integer └── boolean ``` #### Discriminator ```yaml Pet: discriminator: propertyName: petType mapping: dog: "#/components/schemas/Dog" cat: "#/components/schemas/Cat" ``` Displayed with discriminator indicator: ``` Pet (object) discriminator: petType ├── Dog (petType: "dog") └── Cat (petType: "cat") ``` ## Landing Pages *Create beautiful landing pages, portfolios, and contact pages* ### Landing Pages MinimalDoc supports landing pages, portfolio pages, and contact pages. Configure them in `config.yaml` and MinimalDoc renders elegant templates. #### Landing Page The landing page replaces the default documentation index with a marketing-style homepage. ##### Configuration ```yaml landing: enabled: true hero: title: "Your Product Name" subtitle: "A compelling tagline for your product" buttons: - text: "Get Started" url: "/docs/getting-started/" primary: true - text: "View on GitHub" url: "https://github.com/..." primary: false image: "/assets/hero.png" # optional features: title: "Features" items: - emoji: "~" title: "Fast" description: "Sub-second builds" - icon: "moon" title: "Dark Mode" description: "Built-in theme switching" steps: title: "Quick Start" items: - title: "Install" description: "Download the binary" code: "go install github.com/..." - title: "Initialize" description: "Create your docs folder" code: "minimaldoc init my-docs" links: title: "Resources" items: - icon: "github" title: "GitHub" description: "View source code" url: "https://github.com/..." testimonials: items: - quote: "MinimalDoc changed how we write docs" author: "Jane Doe" role: "Lead Developer" avatar: "/assets/jane.png" cta: title: "Ready to get started?" description: "Join thousands of developers" buttons: - text: "Download Now" url: "/releases/" primary: true opensource: title: "Open Source" description: "MIT Licensed. Free forever." links: - text: "GitHub" url: "https://github.com/..." ``` ##### Sections | Section | Description | | -------------- | ------------------------------------------------------------- | | `hero` | Main header with title, subtitle, buttons, and optional image | | `features` | Grid of feature cards with icons/emojis | | `steps` | Numbered quick start steps with code blocks | | `links` | Grid of resource link cards | | `testimonials` | Customer quotes with avatars | | `cta` | Call-to-action section | | `opensource` | Open source info and links | All sections are optional. Only configured sections are rendered. #### New Section Types ##### Image-Text Section Side-by-side image and content layout. ```yaml landing: image_text: - id: "why-choose" title: "Why Choose Us" description: "We deliver results" image: "/images/feature.png" image_alt: "Feature illustration" image_position: "right" # left or right order: 1 items: - icon: "~" title: "Fast Delivery" description: "Quick turnaround times" - icon: "@" title: "Quality First" description: "No compromises" buttons: - text: "Learn More" url: "/about/" primary: true background: color: "#f8f9fa" ``` | Field | Description | |-------|-------------| | `id` | Section identifier | | `title` | Section heading | | `description` | Section description | | `image` | Image URL | | `image_alt` | Image alt text | | `image_position` | `left` or `right` (default: `right`) | | `items` | Optional bullet points with icon, title, description | | `buttons` | Optional CTA buttons | | `background` | Background styling | | `order` | Display order | ##### Text Section Simple centered text block. ```yaml landing: text_blocks: - id: "mission" title: "Our Mission" subtitle: "What drives us" content: "

We believe in making documentation accessible to everyone.

" alignment: "center" # left, center, right max_width: "800px" order: 2 buttons: - text: "Join Us" url: "/careers/" primary: true background: image: "/images/bg.jpg" overlay: "rgba(0,0,0,0.7)" ``` | Field | Description | |-------|-------------| | `id` | Section identifier | | `title` | Section heading | | `subtitle` | Optional subtitle | | `content` | HTML content | | `alignment` | Text alignment: `left`, `center`, `right` | | `max_width` | Maximum content width | | `buttons` | Optional CTA buttons | | `background` | Background styling | | `order` | Display order | ##### Links Grid Section Grid of external link cards. ```yaml landing: links_grid: - id: "platforms" title: "Find Us On" description: "Connect with us across platforms" columns: 4 # 2, 3, or 4 order: 3 items: - icon: "github" title: "GitHub" description: "Source code and issues" url: "https://github.com/..." external: true - icon: "twitter" title: "Twitter" description: "Updates and news" url: "https://twitter.com/..." background: color: "#1a1a2e" ``` | Field | Description | |-------|-------------| | `id` | Section identifier | | `title` | Section heading | | `description` | Section description | | `columns` | Grid columns: 2, 3, or 4 (default: 4) | | `items` | Array of link cards | | `background` | Background styling | | `order` | Display order | **Link card fields:** | Field | Description | |-------|-------------| | `icon` | Icon or emoji | | `title` | Card title | | `description` | Card description | | `url` | Link URL | | `external` | Opens in new tab (auto-detected for http/https) | #### Section Backgrounds All sections support background styling: ```yaml background: image: "/images/bg.jpg" # Background image URL overlay: "rgba(0,0,0,0.6)" # Overlay color color: "#1a1a2e" # Background color position: "center" # Background position size: "cover" # Background size attachment: "fixed" # scroll or fixed ``` | Field | Description | |-------|-------------| | `image` | Background image URL | | `overlay` | Semi-transparent overlay (use with images) | | `color` | Solid background color | | `position` | CSS background-position | | `size` | CSS background-size | | `attachment` | CSS background-attachment | Example with background image: ```yaml landing: cta: title: "Ready to Start?" background: image: "/images/cta-bg.jpg" overlay: "rgba(0,0,0,0.7)" ``` #### Portfolio Page Display projects parsed from markdown files in `__portfolio__/`. ##### Configuration ```yaml portfolio: enabled: true title: "Portfolio" description: "Projects and experiments" path: "portfolio" ``` ##### Project Files Create markdown files in `docs/__portfolio__/`: ```markdown --- title: Project Name description: Short description image: /assets/project.png tags: - go - cli - open-source links: - text: GitHub url: https://github.com/... - text: Demo url: https://demo.example.com date: 2026-01-15 featured: true --- Longer description here. Supports full markdown. ``` ##### Frontmatter Fields | Field | Type | Description | | ------------- | ------- | --------------------------- | | `title` | string | Project title | | `description` | string | Short description for cards | | `image` | string | Project image URL | | `tags` | array | Tags for filtering | | `links` | array | Project links (text, url) | | `date` | string | Date (YYYY-MM-DD) | | `featured` | boolean | Show in featured section | | `menu_order` | number | Sort order | ##### Features - Responsive card grid layout - Client-side tag filtering - Individual project detail pages - Hover effects #### Contact Page Simple contact page with email link and contact info. ##### Configuration ```yaml contact: enabled: true title: "Contact Us" description: "Get in touch" path: "contact" email: "hello@example.com" info: - icon: "mail" text: "hello@example.com" - icon: "location" text: "Remote, Worldwide" - icon: "phone" text: "+1 555 123 4567" ``` ##### Available Icons - `mail` - Email icon - `location` - Map pin icon - `phone` - Phone icon #### Footer Configure a multi-column footer for landing pages. ##### Configuration ```yaml footer: copyright: "2026 Your Company. All rights reserved." links: - title: "Product" items: - text: "Features" url: "/features/" - text: "Documentation" url: "/docs/" - title: "Company" items: - text: "About" url: "/about/" - text: "Blog" url: "/blog/" social: - icon: "github" name: "GitHub" url: "https://github.com/..." - icon: "twitter" name: "Twitter" url: "https://twitter.com/..." badges: - text: "Powered by MinimalDoc" url: "https://minimaldoc.dev" ``` ##### Social Icons Available icons: `github`, `twitter`, `linkedin`, `youtube`, `discord`, `mail` #### Styling All landing page elements use CSS variables for theming: - Light/dark mode automatic switching - Responsive design (mobile-first) - Clean, minimal aesthetic - Consistent with documentation theme Custom CSS can be added via theme overrides. ## FAQ Pages *Frequently asked questions with categories and collapsible answers* ### FAQ Pages Add a FAQ page with categorized questions and collapsible answers. #### Configuration Define questions inline in config.yaml: ```yaml faq: enabled: true title: FAQ description: Frequently asked questions path: faq categories: - name: General items: - question: What is MinimalDoc? answer: A minimal static site generator for documentation. - question: Is it free? answer: Yes, GPL-3.0 licensed. - name: Technical items: - question: What languages are supported for syntax highlighting? answer: 100+ languages via Chroma. ``` #### Markdown-Based FAQ Alternatively, define FAQ items as markdown files in `__faq__/` directory: ``` docs/ __faq__/ 01-what-is-minimaldoc.md 02-installation-issues.md ``` Each file uses frontmatter: ```yaml --- question: What is MinimalDoc? category: General tags: - general - getting-started order: 1 --- MinimalDoc is a minimal static site generator for documentation. It converts Markdown files into a fast, clean HTML site. Markdown content here supports full formatting: - Lists - Code blocks - Links ``` Markdown files allow richer answers than inline YAML. #### Category Configuration | Field | Type | Description | |-------|------|-------------| | `name` | string | Category heading | | `order` | int | Sort order | | `items[].question` | string | Question text | | `items[].answer` | string | Answer text (plain text in YAML) | #### Output The FAQ page is generated at `//index.html`. Questions are grouped by category with collapsible answers. ## Multi-Version Documentation *Maintain documentation for multiple software versions with version-specific content and overrides* MinimalDoc supports maintaining documentation for multiple versions of your software. This feature allows users to switch between documentation versions while sharing common content across versions. #### Configuration Enable multi-version documentation in your `config.yaml`: ```yaml versions: enabled: true default: "v2" list: - name: "v2" label: "2.x (Latest)" path: "v2" - name: "v1" label: "1.x (LTS)" path: "v1" eol: "2025-12-31" selector: position: "header" show_eol_warning: true ``` ##### Configuration Options | Option | Type | Description | |--------|------|-------------| | `enabled` | boolean | Enable multi-version documentation | | `default` | string | Default version to display (used for root URLs) | | `list` | array | List of version definitions | | `selector.position` | string | Where to show version selector: `header` or `sidebar` | | `selector.show_eol_warning` | boolean | Show warning banner for EOL versions | ##### Version Definition Each version in the `list` array supports: | Field | Type | Description | |-------|------|-------------| | `name` | string | Version identifier (e.g., `v2`) | | `label` | string | Display label (e.g., `2.x (Latest)`) | | `path` | string | URL path prefix for this version | | `eol` | string | End of life date in `YYYY-MM-DD` format (optional) | #### Directory Structure ##### Shared Content By default, all pages in your `docs/` directory are shared across all versions. Use frontmatter to control which versions a page appears in. ##### Version-Specific Overrides Create version-specific content in the `__versions__/` directory: ``` docs/ getting-started/ install.md # Shared across all versions config.md # Shared across all versions __versions__/ v1/ getting-started/ config.md # Overrides config.md for v1 migration/ upgrade-guide.md # Only appears in v1 v2/ api/ breaking-changes.md # Only appears in v2 ``` Pages in `__versions__/{version}/` override or extend the shared content for that specific version. #### Frontmatter Fields Control version behavior with frontmatter: ```yaml --- title: Configuration Guide versions: - v1 - v2 since: "v1.5" deprecated_in: "v3" removed_in: "v4" version_note: "v2" --- ``` ##### Available Fields | Field | Type | Description | |-------|------|-------------| | `versions` | array | Versions this page appears in (empty = all versions) | | `since` | string | Version where feature was introduced | | `deprecated_in` | string | Version where feature was deprecated | | `removed_in` | string | Version where feature was removed (page hidden from this version onward) | | `version_note` | string | Version to show special note for | #### URL Structure Multi-version documentation uses URL prefixes: ``` /docs/getting-started/ # Default version (v2) /v1/docs/getting-started/ # Explicit v1 /v2/docs/getting-started/ # Explicit v2 ``` The default version is served from the root URL. Other versions are prefixed with their path. #### Search Integration Each version gets its own search index: - `/search-index.json` - Default version - `/v1/search-index.json` - v1 specific - `/v2/search-index.json` - v2 specific Search results are scoped to the currently viewed version. #### Version Selector A dropdown selector appears in the sidebar allowing users to switch between versions: - Shows the current version label - Lists all available versions - Marks EOL versions with a badge - Persists selection in localStorage When switching versions, users are redirected to the same page in the new version (if it exists) or to the version's root page. #### EOL Warnings For versions that have reached end of life (`eol` date set), MinimalDoc can display: 1. **Badge**: "EOL" badge next to the version in the selector 2. **Warning Banner**: Full-width warning at the top of pages in EOL versions Enable/disable with `selector.show_eol_warning`. #### Build Output When versioning is enabled, the build generates: ``` public/ docs/ # Default version v1/ docs/ search-index.json v2/ docs/ search-index.json versions.json # Version metadata for JS ``` The `versions.json` file contains metadata for client-side version switching. ## Contact Page *Add a contact page with info cards* ### Contact Page Add a contact page with info cards displaying email, location, and other details. #### Configuration ```yaml contact: enabled: true title: Contact description: Get in touch path: contact email: hello@example.com info: - icon: mail text: hello@example.com - icon: location text: Montreal, Canada - icon: website text: https://example.com ``` | Field | Type | Default | Description | |-------|------|---------|-------------| | `enabled` | bool | `false` | Enable contact page | | `title` | string | `"Contact"` | Page title | | `description` | string | `""` | Page description | | `path` | string | `"contact"` | Output path | | `email` | string | `""` | Contact email address | | `info` | array | `[]` | Info cards with icon and text | #### Info Card Icons Available icon identifiers: | Icon | Description | |------|-------------| | `mail` | Email | | `location` | Physical location | | `phone` | Phone number | | `website` | Website URL | | `github` | GitHub profile | | `twitter` | Twitter/X profile | | `discord` | Discord server | #### Output Generated at `//index.html`. A link appears in the site footer if the contact page is enabled. ## Internationalization (i18n) *Multi-language documentation with locale-specific translations, RTL support, and language switching* MinimalDoc supports internationalization (i18n) for building documentation in multiple languages. Translations are stored separately from shared content, with automatic fallback to the default locale when translations are missing. #### Configuration Enable i18n in your `config.yaml`: ```yaml i18n: enabled: true default_locale: "en" fallback: "en" hide_default_locale: true show_untranslated: true locales: - code: "en" name: "English" direction: "ltr" - code: "fr" name: "Français" direction: "ltr" - code: "ar" name: "العربية" direction: "rtl" flag: "🇸🇦" selector: position: "header" show_flags: false ``` ##### Configuration Options | Option | Type | Default | Description | |--------|------|---------|-------------| | `enabled` | boolean | `false` | Enable multi-language documentation | | `default_locale` | string | `"en"` | Default locale code | | `fallback` | string | `"en"` | Fallback locale for missing translations | | `hide_default_locale` | boolean | `true` | Omit locale prefix from URLs for default locale | | `show_untranslated` | boolean | `true` | Show fallback content with warning when translation missing | | `locales` | array | `[]` | List of locale definitions | | `selector.position` | string | `"header"` | Locale selector position: `header` or `sidebar` | | `selector.show_flags` | boolean | `false` | Show flag icons in selector | ##### Locale Definition Each locale in the `locales` array supports: | Field | Type | Required | Description | |-------|------|----------|-------------| | `code` | string | Yes | Locale code (e.g., `en`, `fr`, `de`, `zh-CN`) | | `name` | string | Yes | Display name (e.g., `English`, `Français`) | | `direction` | string | No | Text direction: `ltr` (default) or `rtl` | | `flag` | string | No | Optional flag emoji or icon | #### Directory Structure ##### Shared Content All pages in your `docs/` directory serve as the default locale content. These are shared across all locales unless overridden by a translation. ##### Translation Files Create locale-specific translations in the `__translations__/` directory: ``` docs/ getting-started/ install.md # Default (English) content config.md # Default content features/ search.md # Default content __translations__/ fr/ getting-started/ install.md # French translation config.md # French translation features/ search.md # French translation de/ getting-started/ install.md # German translation (partial) ``` Translation files must match the path and filename of the original content. If a translation file exists, it replaces the default content for that locale. Missing translation files fall back to the default locale content. #### URL Structure With `hide_default_locale: true` (default): ``` /docs/getting-started/ # Default locale (en) /fr/docs/getting-started/ # French /de/docs/getting-started/ # German /ar/docs/getting-started/ # Arabic ``` With `hide_default_locale: false`: ``` /en/docs/getting-started/ # English (explicit) /fr/docs/getting-started/ # French /de/docs/getting-started/ # German ``` #### RTL Support For right-to-left languages (Arabic, Hebrew, Persian), set `direction: "rtl"` in the locale definition: ```yaml locales: - code: "ar" name: "العربية" direction: "rtl" - code: "he" name: "עברית" direction: "rtl" ``` MinimalDoc automatically: 1. Sets the `dir="rtl"` attribute on the HTML element 2. Applies RTL-specific CSS rules for layout mirroring 3. Adjusts navigation and sidebar positioning #### Fallback Behavior When a page is not translated for a locale: 1. If `show_untranslated: true`, the fallback locale content is displayed with a visual indicator 2. If `show_untranslated: false`, the page is omitted from that locale's navigation The fallback chain is: requested locale → `fallback` locale → `default_locale`. #### Version Integration i18n works with multi-version documentation. The URL structure combines both: ``` /fr/v2/docs/getting-started/ # French, version 2 /de/v1/docs/getting-started/ # German, version 1 ``` When both versioning and i18n are enabled: 1. Default locale + default version: `/docs/...` 2. Default locale + other version: `/v1/docs/...` 3. Other locale + default version: `/fr/docs/...` 4. Other locale + other version: `/fr/v1/docs/...` #### Locale Selector A dropdown selector allows users to switch languages: 1. Displays the current locale name (and flag if configured) 2. Lists all available locales 3. Persists selection in localStorage 4. Redirects to the same page in the selected locale (or locale root if page unavailable) Position options: | Position | Description | |----------|-------------| | `header` | Selector appears in the site header | | `sidebar` | Selector appears in the sidebar navigation | #### Build Output When i18n is enabled, the build generates: ``` public/ docs/ # Default locale pages fr/ docs/ # French pages de/ docs/ # German pages locales.json # Locale metadata for JS ``` The `locales.json` file contains metadata for client-side locale switching: ```json { "current": "en", "default": "en", "hideDefaultLocale": true, "locales": [ {"code": "en", "name": "English", "direction": "ltr", "active": true}, {"code": "fr", "name": "Français", "direction": "ltr", "active": false} ] } ``` #### Translation Workflow 1. Write documentation in your default locale 2. Create `__translations__/{locale}/` directories for each target locale 3. Copy files you want to translate, maintaining the same path structure 4. Translate the content while keeping the same frontmatter structure 5. Build the site to generate all locale variations Untranslated pages automatically use fallback content, so you can translate incrementally. ## Legal Pages *Privacy policy, terms of service, and other legal pages* ### Legal Pages Add privacy policy, terms of service, and other legal documents to your site. #### Configuration ```yaml legal: enabled: true path: legal footer_group: Legal ``` | Field | Type | Default | Description | |-------|------|---------|-------------| | `enabled` | bool | `false` | Enable legal pages | | `path` | string | `"legal"` | Output path prefix | | `footer_group` | string | `"Legal"` | Footer section title for legal page links | #### Legal Page Files Create markdown files in `__legal__/` directory: ``` docs/ __legal__/ privacy-policy.md terms-of-service.md cookie-policy.md ``` Each file uses standard frontmatter: ```yaml --- title: Privacy Policy description: How we handle your data order: 1 --- ## Data Collection We collect minimal data necessary for the service... ``` #### Footer Integration Legal pages are automatically added to a footer link group with the title specified by `footer_group`. Links appear in the order defined by the `order` frontmatter field. #### Output Each file generates a page at `//.html`: - `__legal__/privacy-policy.md` -> `/legal/privacy-policy.html` - `__legal__/terms-of-service.md` -> `/legal/terms-of-service.html` ## Analytics *Plugin-based analytics system with support for multiple providers* ### Analytics MinimalDoc includes a plugin-based analytics system that supports multiple providers simultaneously. Each provider is independently configurable, and custom/self-hosted solutions can be integrated using the `custom` provider type. #### Configuration Enable analytics in your `config.yaml`: ```yaml analytics: enabled: true providers: - type: plausible enabled: true config: domain: "docs.example.com" ``` #### Supported Providers | Provider | Type Key | Required Config | Script Location | |----------|----------|-----------------|-----------------| | Google Analytics 4 | `ga4` | `measurement_id` | head | | Plausible | `plausible` | `domain` | head | | Umami | `umami` | `website_id`, `src` | head | | Matomo | `matomo` | `url`, `site_id` | head | | Fathom | `fathom` | `site_id` | head | | Simple Analytics | `simple` | (none) | head | | Custom | `custom` | `src` | configurable | #### Provider Examples ##### Google Analytics 4 ```yaml analytics: enabled: true providers: - type: ga4 enabled: true config: measurement_id: "G-XXXXXXXXXX" ``` ##### Plausible Standard Plausible.io: ```yaml analytics: enabled: true providers: - type: plausible enabled: true config: domain: "docs.example.com" ``` Self-hosted Plausible: ```yaml analytics: enabled: true providers: - type: plausible enabled: true config: domain: "docs.example.com" src: "https://analytics.your-domain.com/js/script.js" ``` ##### Umami ```yaml analytics: enabled: true providers: - type: umami enabled: true config: website_id: "your-website-uuid" src: "https://analytics.example.com/script.js" ``` ##### Matomo ```yaml analytics: enabled: true providers: - type: matomo enabled: true config: url: "https://matomo.example.com" site_id: "1" ``` ##### Fathom ```yaml analytics: enabled: true providers: - type: fathom enabled: true config: site_id: "ABCDEFGH" ``` Self-hosted: ```yaml analytics: enabled: true providers: - type: fathom enabled: true config: site_id: "ABCDEFGH" src: "https://analytics.your-domain.com/tracker.js" ``` ##### Simple Analytics ```yaml analytics: enabled: true providers: - type: simple enabled: true ``` ##### Custom Provider For any analytics service not directly supported, use the `custom` type: ```yaml analytics: enabled: true providers: - type: custom enabled: true config: src: "https://my-analytics.example.com/tracker.js" defer: "true" async: "false" location: "head" # or "body" attrs: data-site-id: "my-site" data-cookieless: "true" data-no-pii: "true" ``` The `attrs` map allows passing arbitrary data attributes to the script tag. #### Multiple Providers Run multiple analytics providers simultaneously: ```yaml analytics: enabled: true providers: - type: plausible enabled: true config: domain: "docs.example.com" - type: ga4 enabled: false # Disabled but kept in config config: measurement_id: "G-XXXXXXXXXX" - type: custom enabled: true config: src: "https://internal-analytics.example.com/t.js" defer: "true" attrs: data-site: "docs" ``` Only providers with `enabled: true` will have their scripts injected. #### Script Injection Analytics scripts are injected in two locations: 1. **Head scripts** (before ``) - Most providers inject here 2. **Body scripts** (before ``) - Custom providers can use `location: body` Scripts are injected on all page types: - Documentation pages - Landing pages - Status pages - Changelog - FAQ - Contact - Legal pages - Knowledge Base - Portfolio - OpenAPI documentation #### Privacy Considerations When choosing an analytics provider, consider: - **GDPR compliance** - Some providers require cookie consent banners - **Cookieless tracking** - Plausible, Fathom, and Simple Analytics are cookieless by default - **Self-hosting** - Plausible, Umami, and Matomo can be self-hosted for full data control - **Data retention** - Check provider policies on how long data is stored ## MCP Server Documentation *Publish static reference pages for MCP servers from JSON manifests* ### MCP Server Documentation Generate a static reference page for your MCP server — tools, resources, and prompts — directly from a JSON manifest file. No server required at runtime. #### How It Works At build time, minimaldoc reads a `.mcp.json` manifest file from your docs directory and generates a self-contained HTML reference page under `/mcp/`. The output is pure static HTML with no JavaScript dependencies. ``` minimaldoc build --mcp ``` Generates: ``` public/ └── mcp/ └── my-server/ └── index.html # Tool list, parameters, resources, prompts ``` #### Manifest Format Create a `.mcp.json` file describing your MCP server's capabilities. The format mirrors the MCP protocol's list responses: ```json { "name": "My MCP Server", "description": "Tools for interacting with my service", "tools": [ { "name": "create_item", "description": "Create a new item in the database", "inputSchema": { "type": "object", "properties": { "name": { "type": "string", "description": "Item name" }, "tags": { "type": "array", "description": "Optional tags", "items": { "type": "string" } } }, "required": ["name"] } } ], "resources": [ { "uri": "file:///data/config.json", "name": "Server Config", "description": "Current server configuration", "mimeType": "application/json" } ], "prompts": [ { "name": "summarize", "description": "Summarize recent activity", "arguments": [ { "name": "period", "description": "Time period to summarize (e.g. '7d', '30d')", "required": true } ] } ] } ``` Place the file anywhere under your docs directory (e.g. `mcp/server.mcp.json`). Auto-discovery picks up all `*.mcp.json` files. #### Generating a Manifest Dump the capabilities of a running MCP server using the MCP inspector: ```bash npx @modelcontextprotocol/inspector --json > mcp/server.mcp.json ``` Or write it manually — the format is straightforward JSON. #### Configuration Enable in `config.yaml`: ```yaml mcp: enabled: true spec_files: - "mcp/*.mcp.json" path: "mcp" ``` Or via CLI flag: ```bash minimaldoc build --mcp minimaldoc build --mcp --mcp-dir mcp ``` | Field | Type | Default | Description | |-------|------|---------|-------------| | `enabled` | boolean | `false` | Enable MCP docs generation | | `spec_files` | array of string | `[]` | Manifest file paths or globs relative to docs root | | `path` | string | `"mcp"` | Output URL path | When `spec_files` is empty, minimaldoc auto-discovers all `*.mcp.json` files under the docs root. #### Output Structure Each manifest generates a page at `/{path}/{spec-name}/index.html`. With a single manifest, `/mcp/index.html` redirects directly to the spec page. With multiple manifests, `/mcp/index.html` lists all available servers. #### What Gets Rendered The generated page shows: - **Tools** — each tool with its name, description, and a parameter table (name, type, required/optional, description). Nested object properties are rendered as sub-tables. - **Resources** — table of all resources with URI, name, MIME type, and description. - **Prompts** — each prompt with its name, description, and argument table. Sections with no entries are omitted. ## PDF Export *Export documentation pages as PDF files* ### PDF Export Add an "Export PDF" button to each documentation page. Uses the browser's native print-to-PDF. #### Configuration ```yaml pdf_export: enabled: true page_break_level: 2 ``` | Field | Type | Default | Description | |-------|------|---------|-------------| | `enabled` | bool | `false` | Show the Export PDF button on each page | | `page_break_level` | int | `1` | Heading level for page breaks: 0=none, 1=h1 only, 2=h1+h2 | #### How It Works The button triggers `window.print()` with a print-optimized stylesheet. The generated PDF: - Strips sidebar, navigation, and interactive elements - Preserves code blocks with syntax highlighting - Inserts page breaks before headings (configurable level) - Includes the page title and URL in headers/footers (browser-dependent) #### Page Break Levels | Value | Behavior | |-------|----------| | `0` | No forced page breaks | | `1` | Page break before every `h1` | | `2` | Page break before every `h1` and `h2` | #### Button Placement The button appears in the page title row alongside other action buttons (Copy MD, Ask Claude). On mobile, buttons wrap below the title. #### Print Stylesheet MinimalDoc includes a `@media print` stylesheet that: - Hides the sidebar, header, footer, and search - Expands content to full width - Preserves code block backgrounds - Forces black text for readability - Removes interactive elements (buttons, toggles) #### Limitations - Output depends on the browser's print engine (Chrome recommended) - Complex tables may not paginate cleanly - Embedded images must be accessible at print time - Header/footer content varies by browser ## Claude Assist *Add an AI assistant button to documentation pages* ### Claude Assist Add an "Ask Claude" button to each page that opens Claude with the page content as context. #### Configuration ```yaml claude_assist: enabled: true label: Ask Claude prompt: "Answer based on this documentation page:" ``` | Field | Type | Default | Description | |-------|------|---------|-------------| | `enabled` | bool | `false` | Show the Ask Claude button on each page | | `label` | string | `"Ask Claude"` | Button text | | `prompt` | string | `""` | Custom prompt prefix prepended to the page content | #### How It Works When clicked, the button: 1. Extracts the current page's markdown content (from the companion `.html.md` file) 2. Prepends the optional custom prompt 3. Opens Claude (claude.ai) with the content as context This requires `enable_llms: true` since the button depends on the generated `.html.md` companion files. #### Use Cases - Let users ask follow-up questions about complex configuration - Provide an AI-powered support layer on top of static docs - Help users translate documentation concepts to their specific use case #### Button Placement The button appears in the page title row alongside other action buttons (Export PDF, Copy MD). On mobile, buttons wrap below the title. #### Custom Prompts The `prompt` field lets you customize how Claude interprets the page: ```yaml # Technical docs claude_assist: enabled: true prompt: "You are a technical support engineer. Answer based on this documentation:" # API reference claude_assist: enabled: true label: "Explain this API" prompt: "Explain this API endpoint in simple terms:" ``` When no prompt is set, the page content is sent as-is. ## MinimalDoc *A modern, minimal static site generator for beautiful documentation* ### MinimalDoc A fast, minimal static site generator designed for documentation. Write in Markdown, generate beautiful sites. #### Why MinimalDoc? MinimalDoc focuses on what matters: your content. No complex configuration, no bloated dependencies, no unnecessary features. | Feature | MinimalDoc | |---------|------------| | Build Speed | Sub-second for most sites | | Configuration | Single YAML file | | Dependencies | Zero runtime dependencies | | Output | Pure static HTML/CSS/JS | | Deployment | Any static host | #### Core Features **Content** - Markdown with YAML frontmatter - GitHub Flavored Markdown (tables, task lists, strikethrough) - Syntax highlighting for 100+ languages - Custom admonitions (info, warning, danger, success) **Navigation** - Automatic navigation from folder structure - Custom navigation via TOC.md - Auto-generated page table of contents - Keyboard-accessible search (Cmd+K) **Design** - Clean, responsive layout - Dark/light mode with persistence - CSS-only theming - Mobile-first approach **Integrations** - OpenAPI/Swagger documentation - Status page with incidents and uptime - Changelog with RSS feed - LLM-friendly output (llms.txt) #### Quick Start ```bash # Install go install github.com/studiowebux/minimaldoc/cmd/minimaldoc@latest # Initialize (basic) minimaldoc init my-docs # Or initialize with all features (status page, changelog, OpenAPI) minimaldoc init my-docs --full # Build minimaldoc build my-docs ``` Output in `public/`. Open `public/index.html` to preview. #### Documentation - [Installation](getting-started/01-installation.md) - Install MinimalDoc - [Quick Start](getting-started/02-quick-start.md) - Create your first site - [Configuration](getting-started/03-configuration.md) - Configure your site - [Features Overview](features/01-overview.md) - Explore all features #### License [GPL-3.0](https://github.com/studiowebux/minimaldoc/blob/main/LICENSE)