Skip to content

Commit 6f96397

Browse files
committed
feat(docs): integrate MkDocs with GitHub Pages deployment
1 parent 97618e5 commit 6f96397

4 files changed

Lines changed: 137 additions & 1 deletion

File tree

.github/workflows/docs.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: docs
2+
on:
3+
push:
4+
branches:
5+
- main
6+
permissions:
7+
contents: write
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-python@v5
14+
with:
15+
python-version: 3.x
16+
- run: echo "cache_id=$(date --utc +%V)" >> $GITHUB_ENV
17+
- uses: actions/cache@v4
18+
with:
19+
key: mkdocs-material-${{ env.cache_id }}
20+
path: .cache
21+
restore-keys: |
22+
mkdocs-material-
23+
- run: pip install mkdocs-material mkdocstrings[python]
24+
- run: mkdocs gh-deploy --force

makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
.PHONY: all test lint format
1+
.PHONY: all test lint format docs-serve docs-build
22

33
all: test lint
44

55
test:
66
@echo "Running tests..."
7+
8+
docs-serve:
9+
@mkdocs serve
10+
11+
docs-build:
12+
@mkdocs build

mkdocs.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
site_name: Gemini CLI Opinionated Framework
2+
site_url: https://apiad.github.io/starter
3+
repo_url: https://github.com/apiad/starter
4+
edit_uri: edit/main/docs/
5+
6+
theme:
7+
name: material
8+
palette:
9+
- media: "(prefers-color-scheme: light)"
10+
scheme: default
11+
primary: indigo
12+
accent: indigo
13+
toggle:
14+
icon: material/brightness-7
15+
name: Switch to dark mode
16+
- media: "(prefers-color-scheme: dark)"
17+
scheme: slate
18+
primary: indigo
19+
accent: indigo
20+
toggle:
21+
icon: material/brightness-4
22+
name: Switch to light mode
23+
features:
24+
- navigation.tabs
25+
- navigation.sections
26+
- navigation.top
27+
- search.suggest
28+
- search.highlight
29+
30+
plugins:
31+
- search
32+
- mkdocstrings:
33+
handlers:
34+
python:
35+
setup_commands:
36+
- import sys
37+
- sys.path.append(".")
38+
39+
nav:
40+
- Home: index.md
41+
- Setup & Deployment: deploy.md
42+
- Architecture & Design: design.md
43+
- Development & Contribution: develop.md
44+
45+
markdown_extensions:
46+
- admonition
47+
- pymdownx.details
48+
- pymdownx.superfences
49+
- pymdownx.tabbed:
50+
alternate_style: true
51+
- pymdownx.emoji:
52+
emoji_index: !!python/name:material.extensions.emoji.twemoji
53+
emoji_generator: !!python/name:material.extensions.emoji.to_svg

plans/mkdocs-integration.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Execution Plan: MkDocs Integration for GitHub Pages
2+
3+
This plan outlines the steps to integrate MkDocs into the project for automatic GitHub Pages deployment via CI/CD.
4+
5+
### Objective
6+
Provide a professional, web-based documentation portal at `https://apiad.github.io/starter` that is automatically synchronized with the codebase via CI/CD.
7+
8+
### Architectural Impact
9+
- Introduces MkDocs as a static site generator for project documentation.
10+
- Extends the GitHub Actions CI/CD pipeline to automatically build and deploy the `docs/` folder to GitHub Pages.
11+
- Enhances local development tooling (`makefile`) to easily build and preview documentation.
12+
13+
### File Operations
14+
- **`mkdocs.yml`** (Create): Core configuration file for MkDocs.
15+
- **`.github/workflows/docs.yml`** (Create): GitHub Actions workflow for CI/CD deployment.
16+
- **`docs/index.md`** (Modify): Add a prominent "Setup" or "Quick Start" section.
17+
- **`makefile`** (Modify): Add `docs-serve` and `docs-build` commands.
18+
- **`TASKS.md`** (Update): Add the new task to the appropriate section.
19+
- **`journal/`** (Update): Add a journal entry to log the completion of this integration.
20+
21+
### Step-by-Step Execution
22+
23+
**Step 1: Create `mkdocs.yml`**
24+
Create a `mkdocs.yml` file in the repository root with the following configuration:
25+
- `site_name`: Gemini CLI Opinionated Framework
26+
- `site_url`: `https://apiad.github.io/starter`
27+
- `theme`: Material theme with dark mode support and search enabled.
28+
- `plugins`: Include `search` and `mkdocstrings` (with Python handler).
29+
- `nav`: Map the navigation to the existing `docs/` structure.
30+
31+
**Step 2: Setup CI/CD Deployment**
32+
Create `.github/workflows/docs.yml` to automate deployment:
33+
- Trigger on `push` to the `main` branch.
34+
- Deploy to the `gh-pages` branch using `mkdocs gh-deploy --force`.
35+
36+
**Step 3: Refine `docs/index.md`**
37+
- Add a prominent "Quick Start" section right after the philosophy to bring visibility to the primary installation command.
38+
- Ensure the Markdown is compatible with MkDocs Material.
39+
40+
**Step 4: Update `makefile`**
41+
Add the following targets:
42+
- `docs-serve`: For local live-reloading preview.
43+
- `docs-build`: To generate the static site locally.
44+
45+
**Step 5: Log Progress**
46+
- Update `TASKS.md`: Add an entry under the Archive for MkDocs integration.
47+
- Update the latest journal entry in `journal/` to log the changes.
48+
49+
### Testing Strategy
50+
1. **Local Preview:** Run `make docs-serve` locally. Verify rendering, theme, and navigation.
51+
2. **Build Verification:** Run `make docs-build` to ensure the site builds without warnings.
52+
3. **CI/CD Testing:** Push to `main` and verify the GitHub Actions workflow completion.
53+
4. **Live Site Verification:** Visit `https://apiad.github.io/starter`.

0 commit comments

Comments
 (0)