Skip to content

Commit 8a65f5b

Browse files
authored
Merge pull request #1 from ch-dev401:feat/documentation
Add MkDocs documentation for ReadTheDocs
2 parents e25cdb7 + ecf8eb6 commit 8a65f5b

23 files changed

+4335
-4
lines changed

.readthedocs.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Read the Docs configuration file
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
version: 2
5+
6+
# Set the OS, Python version and other tools you might need
7+
build:
8+
os: ubuntu-22.04
9+
tools:
10+
python: "3.12"
11+
12+
# Build documentation in the docs/ directory with MkDocs
13+
mkdocs:
14+
configuration: mkdocs.yml
15+
16+
# Optionally build your docs in additional formats such as PDF and ePub
17+
formats:
18+
- pdf
19+
- epub
20+
21+
# Optional but recommended, declare the Python requirements required
22+
# to build your documentation
23+
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
24+
python:
25+
install:
26+
- requirements: docs/requirements.txt
27+
- method: pip
28+
path: .

Makefile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ help:
2525
@echo " make upload Upload to PyPI"
2626
@echo ""
2727
@echo "Documentation:"
28-
@echo " make docs Build documentation"
28+
@echo " make docs Build Sphinx documentation"
29+
@echo " make mkdocs-serve Serve MkDocs locally (port 8000)"
30+
@echo " make mkdocs-build Build MkDocs site"
31+
@echo " make mkdocs-deploy Deploy MkDocs with mike (versioning)"
2932

3033
install:
3134
pip install -e .
@@ -82,9 +85,18 @@ upload: build
8285
docs:
8386
cd docs && make html
8487

88+
mkdocs-serve:
89+
mkdocs serve
90+
91+
mkdocs-build:
92+
mkdocs build
93+
94+
mkdocs-deploy:
95+
mike deploy --push --update-aliases $(VERSION) latest
96+
8597
# Shortcut aliases
8698
fmt: format
8799
l: lint
88100
t: test
89101
tc: test-cov
90-
b: build
102+
b: build

docs/READTHEDOCS_DEPLOYMENT.md

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# ReadTheDocs Deployment Guide
2+
3+
This guide walks you through deploying the MongoDB Query Builder documentation to ReadTheDocs.io.
4+
5+
## Prerequisites
6+
7+
- GitHub repository with the documentation
8+
- ReadTheDocs account (free at readthedocs.org)
9+
- MkDocs documentation set up (already done!)
10+
11+
## Local Testing
12+
13+
First, test the documentation locally:
14+
15+
```bash
16+
# Install MkDocs dependencies
17+
pip install -r docs/requirements.txt
18+
19+
# Serve documentation locally
20+
mkdocs serve
21+
22+
# Visit http://localhost:8000 to preview
23+
```
24+
25+
## ReadTheDocs Setup
26+
27+
### 1. Import Project
28+
29+
1. Log in to [ReadTheDocs.org](https://readthedocs.org)
30+
2. Click "Import a Project"
31+
3. Select "Import from GitHub"
32+
4. Choose your `mongodb-builder` repository
33+
5. Click "Next"
34+
35+
### 2. Project Configuration
36+
37+
ReadTheDocs will automatically detect the `.readthedocs.yaml` file. Verify these settings:
38+
39+
- **Name**: MongoDB Query Builder
40+
- **Repository URL**: Your GitHub repo URL
41+
- **Default branch**: main (or master)
42+
- **Documentation type**: MkDocs (auto-detected)
43+
44+
### 3. Advanced Settings
45+
46+
In the project admin panel:
47+
48+
1. **Domains**:
49+
- Default: `mongodb-query-builder.readthedocs.io`
50+
- Can add custom domain later
51+
52+
2. **Versions**:
53+
- Enable version tags for releases
54+
- Set "latest" as default version
55+
56+
3. **Build Settings**:
57+
- Build on push: ✓
58+
- Build pull requests: ✓ (optional)
59+
60+
### 4. Environment Variables (if needed)
61+
62+
If you need any environment variables, add them in:
63+
Admin → Environment Variables
64+
65+
## GitHub Integration
66+
67+
### Webhook Setup
68+
69+
ReadTheDocs automatically sets up a webhook. Verify in your GitHub repo:
70+
71+
1. Go to Settings → Webhooks
72+
2. You should see a ReadTheDocs webhook
73+
3. It triggers on push events
74+
75+
### Build Status Badge
76+
77+
Add to your README.md:
78+
79+
```markdown
80+
[![Documentation Status](https://readthedocs.org/projects/mongodb-query-builder/badge/?version=latest)](https://mongodb-query-builder.readthedocs.io/en/latest/?badge=latest)
81+
```
82+
83+
## Version Management
84+
85+
For version management with `mike`:
86+
87+
```bash
88+
# Install mike
89+
pip install mike
90+
91+
# Deploy initial version
92+
mike deploy --push --update-aliases 0.1.0 latest
93+
94+
# Deploy new version
95+
mike deploy --push --update-aliases 0.2.0 latest
96+
97+
# List versions
98+
mike list
99+
100+
# Set default version
101+
mike set-default --push latest
102+
```
103+
104+
## Troubleshooting
105+
106+
### Build Failures
107+
108+
1. Check build logs in ReadTheDocs dashboard
109+
2. Common issues:
110+
- Missing dependencies in `docs/requirements.txt`
111+
- Incorrect `mkdocs.yml` syntax
112+
- Python version mismatch
113+
114+
### Custom Domain
115+
116+
To use a custom domain:
117+
118+
1. Add CNAME record pointing to `readthedocs.io`
119+
2. Add domain in ReadTheDocs admin panel
120+
3. Enable HTTPS
121+
122+
### Search Not Working
123+
124+
Ensure in `mkdocs.yml`:
125+
- Search plugin is enabled
126+
- Language is set correctly
127+
128+
## Maintenance
129+
130+
### Updating Documentation
131+
132+
1. Make changes to documentation files
133+
2. Commit and push to GitHub
134+
3. ReadTheDocs automatically rebuilds
135+
136+
### Monitoring
137+
138+
- Check build status in ReadTheDocs dashboard
139+
- Monitor 404 errors in analytics
140+
- Review search queries for missing content
141+
142+
## Next Steps
143+
144+
1. Complete placeholder documentation files
145+
2. Add more examples and tutorials
146+
3. Set up documentation versioning
147+
4. Consider adding:
148+
- API changelog
149+
- Contributing guide
150+
- Architecture diagrams
151+
- Video tutorials
152+
153+
## Resources
154+
155+
- [ReadTheDocs Documentation](https://docs.readthedocs.io/)
156+
- [MkDocs Documentation](https://www.mkdocs.org/)
157+
- [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/)
158+
- [Mike Documentation](https://github.com/jimporter/mike)

0 commit comments

Comments
 (0)