Skip to content

Commit 4006e3f

Browse files
authored
πŸ€– Add mdbook documentation with mermaid and CI/CD (#42)
## Overview Sets up fast-building documentation using **mdbook** with mermaid diagram support and automatic deployment to GitHub Pages. ## Features - βœ… **mdbook** - Rust-based, blazingly fast builds - βœ… **Mermaid diagrams** - Visual architecture documentation - βœ… **Link checking** - Validates all links during build - βœ… **GitHub Pages CI/CD** - Auto-deploys on push to main - βœ… **Example pages** - Introduction, Getting Started, Architecture ## Commands Added ```bash bun docs # Serve with hot reload + open browser bun docs:build # Build static site bun docs:watch # Watch for changes ``` ## CI/CD - `.github/workflows/docs.yml` triggers on docs/ changes - Deploys to https://ammarbandukwala.github.io/cmux - Can be manually triggered ## Structure ``` docs/ β”œβ”€β”€ book.toml # Config (mermaid + linkcheck) β”œβ”€β”€ README.md # Documentation for contributors β”œβ”€β”€ src/ β”‚ β”œβ”€β”€ SUMMARY.md # Table of contents β”‚ β”œβ”€β”€ intro.md β”‚ β”œβ”€β”€ getting-started.md β”‚ └── architecture.md # With mermaid diagrams └── book/ # Build output (gitignored) ``` --- _Generated with `cmux`_
1 parent 4d944e2 commit 4006e3f

File tree

18 files changed

+938
-429
lines changed

18 files changed

+938
-429
lines changed

β€Ž.github/workflows/docs.ymlβ€Ž

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Deploy Docs
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
paths:
7+
- "docs/**"
8+
- ".github/workflows/docs.yml"
9+
workflow_dispatch: # Allow manual triggering
10+
11+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Allow only one concurrent deployment
18+
concurrency:
19+
group: "pages"
20+
cancel-in-progress: false
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Setup mdBook
30+
uses: peaceiris/actions-mdbook@v2
31+
with:
32+
mdbook-version: "0.4.52"
33+
34+
- name: Install mdbook-mermaid
35+
run: |
36+
cargo install mdbook-mermaid --version 0.16.0
37+
mdbook-mermaid install docs
38+
39+
- name: Install mdbook-linkcheck
40+
run: cargo install mdbook-linkcheck --version 0.7.7
41+
42+
- name: Build docs
43+
run: cd docs && mdbook build
44+
45+
- name: Upload artifact
46+
uses: actions/upload-pages-artifact@v3
47+
with:
48+
path: ./docs/book
49+
50+
deploy:
51+
environment:
52+
name: github-pages
53+
url: ${{ steps.deployment.outputs.page_url }}
54+
runs-on: ubuntu-latest
55+
needs: build
56+
steps:
57+
- name: Deploy to GitHub Pages
58+
id: deployment
59+
uses: actions/deploy-pages@v4

β€Ž.gitignoreβ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ release
6262

6363
# Documentation
6464
docs/vercel/
65+
docs/book/
66+
docs/mermaid-init.js
67+
docs/mermaid.min.js
6568

6669
# Secrets
6770
.env

β€ŽAGENTS.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CLAUDE.md
1+
docs/src/AGENTS.md

0 commit comments

Comments
Β (0)