Skip to content

Commit 81d1820

Browse files
YosefAshenaficlaude
andcommitted
feat: Add comprehensive MkDocs documentation with GitHub Pages auto-deployment
This commit implements a complete documentation infrastructure: **MkDocs Setup:** - Configured mkdocs.yml with Material theme - Professional styling with dark/light mode toggle - Full-text search with suggestions - Code copy buttons and syntax highlighting - Enhanced navigation with tabs and expandable sections - Git revision dates for "Last Updated" info **Documentation Structure (25 files):** - Hierarchical docs/ folder mirroring repository structure - Components: Dialogs, Confirm dialog - Features: App Settings, Theme system, Device Info - Utilities: String, Enum, Observer, React Context, Theme, etc. - Storages: MMKV, localStorage - States: State management documentation - Types: TypeScript definitions **GitHub Pages Automation:** - GitHub Actions workflow (deploy-docs.yml) - Triggers on push to master or manual workflow_dispatch - Monitors changes to docs/, mkdocs.yml, and .md files - Automatically builds and deploys to gh-pages branch - Published at: https://hacktoolkit.github.io/expo-htk/ **Developer Tools:** - requirements-docs.txt for Python dependencies - docs/BUILD.md with local development instructions - .gitignore to exclude build artifacts - .coderabbit.yaml to minimize documentation review noise The documentation system is now ready for local development and automatic publishing. 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]>
1 parent 26186ef commit 81d1820

File tree

29 files changed

+9256
-0
lines changed

29 files changed

+9256
-0
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Deploy Documentation to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- 'docs/**'
9+
- 'mkdocs.yml'
10+
- '**.md'
11+
- '.github/workflows/deploy-docs.yml'
12+
workflow_dispatch:
13+
14+
jobs:
15+
deploy:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: write
19+
pages: write
20+
id-token: write
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Set up Python
29+
uses: actions/setup-python@v4
30+
with:
31+
python-version: '3.11'
32+
cache: 'pip'
33+
34+
- name: Install dependencies
35+
run: |
36+
pip install --upgrade pip
37+
pip install mkdocs mkdocs-material mkdocs-git-revision-date-localized pymdown-extensions
38+
39+
- name: Build documentation
40+
run: mkdocs build
41+
42+
- name: Deploy to GitHub Pages
43+
uses: peaceiris/actions-gh-pages@v3
44+
with:
45+
github_token: ${{ secrets.GITHUB_TOKEN }}
46+
publish_dir: ./site
47+
cname: expo-htk-docs.example.com
48+
force_orphan: false
49+
50+
- name: Create deployment status
51+
if: always()
52+
run: |
53+
echo "Documentation deployment status: ${{ job.status }}"
54+
echo "Build completed at: $(date -u +'%Y-%m-%dT%H:%M:%SZ')"

.gitignore

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# MkDocs
2+
site/
3+
.mkdocs.yml.bak
4+
5+
# Python
6+
__pycache__/
7+
*.py[cod]
8+
*$py.class
9+
*.so
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
27+
# Virtual environments
28+
venv/
29+
ENV/
30+
env/
31+
.venv
32+
33+
# IDE
34+
.vscode/
35+
.idea/
36+
*.swp
37+
*.swo
38+
*~
39+
.DS_Store
40+
41+
# Node modules
42+
node_modules/
43+
npm-debug.log
44+
45+
# Environment variables
46+
.env
47+
.env.local
48+
.env.*.local
49+
50+
# Build output
51+
*.tsbuildinfo

docs/BUILD.md

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
# Building Documentation Locally
2+
3+
This guide explains how to build and serve the MkDocs documentation locally for development and testing.
4+
5+
## Prerequisites
6+
7+
- Python 3.8 or higher
8+
- pip package manager
9+
10+
## Installation
11+
12+
### 1. Create a Virtual Environment (Recommended)
13+
14+
```bash
15+
python -m venv venv
16+
source venv/bin/activate # On Windows: venv\Scripts\activate
17+
```
18+
19+
### 2. Install Dependencies
20+
21+
```bash
22+
pip install -r requirements-docs.txt
23+
```
24+
25+
Or install manually:
26+
27+
```bash
28+
pip install mkdocs mkdocs-material mkdocs-git-revision-date-localized pymdown-extensions
29+
```
30+
31+
## Building Documentation
32+
33+
### Serve Locally (Development)
34+
35+
```bash
36+
mkdocs serve
37+
```
38+
39+
This will:
40+
- Build the documentation
41+
- Start a local server at `http://localhost:8000`
42+
- Watch for file changes and auto-reload
43+
44+
### Build Static Site
45+
46+
```bash
47+
mkdocs build
48+
```
49+
50+
This will:
51+
- Generate static HTML files in the `site/` directory
52+
- Ready for deployment to GitHub Pages
53+
54+
## Configuration
55+
56+
The documentation is configured in `mkdocs.yml`. Key configurations:
57+
58+
- **Site name**: Hacktoolkit HTK
59+
- **Theme**: Material for MkDocs
60+
- **Documentation root**: `docs/` directory
61+
- **Navigation**: Defined in `nav` section of mkdocs.yml
62+
63+
## File Structure
64+
65+
```
66+
docs/
67+
├── index.md # Home page
68+
├── components/ # Component documentation
69+
│ ├── index.md
70+
│ └── dialogs/
71+
├── features/ # Feature documentation
72+
│ ├── index.md
73+
│ ├── appsettings/
74+
│ ├── theme/
75+
│ └── expo/
76+
├── utils/ # Utility documentation
77+
│ ├── index.md
78+
│ ├── string.md
79+
│ ├── enum.md
80+
│ └── ...
81+
├── storages/ # Storage documentation
82+
├── states/ # State management docs
83+
└── types/ # Type definitions docs
84+
```
85+
86+
## Adding New Documentation
87+
88+
1. Create a new `.md` file in the appropriate folder
89+
2. Add an entry to the `nav` section in `mkdocs.yml`
90+
3. Use the following front matter for consistency:
91+
92+
```markdown
93+
# Page Title
94+
95+
## Overview
96+
Brief description of the topic.
97+
98+
## Usage
99+
Examples and how-tos.
100+
101+
## API Reference
102+
Detailed function/component signatures.
103+
104+
## Best Practices
105+
Recommended patterns.
106+
```
107+
108+
## Deployment
109+
110+
### Automatic (GitHub Actions)
111+
112+
Documentation is automatically deployed to GitHub Pages when:
113+
- Changes are pushed to the `master` branch
114+
- Files in `docs/`, `mkdocs.yml`, or `**.md` are modified
115+
116+
The workflow is defined in `.github/workflows/deploy-docs.yml`
117+
118+
### Manual Deployment
119+
120+
```bash
121+
mkdocs gh-deploy
122+
```
123+
124+
This will:
125+
- Build the documentation
126+
- Push to the `gh-pages` branch
127+
- Deploy to GitHub Pages
128+
129+
## Troubleshooting
130+
131+
### Import Error: No module named 'mkdocs'
132+
133+
```bash
134+
pip install -r requirements-docs.txt
135+
```
136+
137+
### Port 8000 Already in Use
138+
139+
```bash
140+
mkdocs serve -a localhost:8001
141+
```
142+
143+
### Changes Not Reflecting
144+
145+
- Stop the server (Ctrl+C)
146+
- Rebuild: `mkdocs serve`
147+
- Clear browser cache (Ctrl+Shift+Delete)
148+
149+
## Documentation Standards
150+
151+
- Use Markdown format (`.md`)
152+
- Follow the existing structure and naming conventions
153+
- Include code examples in appropriate language blocks
154+
- Use meaningful headers and sections
155+
- Keep documentation up-to-date with code changes
156+
157+
## More Information
158+
159+
- [MkDocs Documentation](https://www.mkdocs.org/)
160+
- [Material Theme Guide](https://squidfunk.github.io/mkdocs-material/)
161+
- [Markdown Reference](https://www.markdownguide.org/)
162+

0 commit comments

Comments
 (0)