Skip to content

Commit 0f69f41

Browse files
committed
Migrate docs build to MkDocs
1 parent 1dc4ce9 commit 0f69f41

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+3123
-4522
lines changed

.github/workflows/docs.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'docs/**'
8+
- 'mkdocs.yml'
9+
- 'requirements_dev.txt'
10+
- '.github/workflows/docs.yml'
11+
pull_request:
12+
paths:
13+
- 'docs/**'
14+
- 'mkdocs.yml'
15+
- 'requirements_dev.txt'
16+
- '.github/workflows/docs.yml'
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: '3.12'
28+
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install -r requirements_dev.txt
33+
34+
- name: Build documentation
35+
run: mkdocs build
36+
37+
- name: Upload site artifact
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: gunicorn-site
41+
path: site
42+
retention-days: 7
43+
44+
deploy:
45+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
46+
needs: build
47+
runs-on: ubuntu-latest
48+
permissions:
49+
contents: write
50+
steps:
51+
- uses: actions/checkout@v4
52+
53+
- name: Set up Python
54+
uses: actions/setup-python@v5
55+
with:
56+
python-version: '3.12'
57+
58+
- name: Install dependencies
59+
run: |
60+
python -m pip install --upgrade pip
61+
pip install -r requirements_dev.txt
62+
63+
- name: Build documentation
64+
run: mkdocs build
65+
66+
- name: Deploy to GitHub Pages
67+
uses: peaceiris/actions-gh-pages@v4
68+
with:
69+
github_token: ${{ secrets.GITHUB_TOKEN }}
70+
publish_dir: site
71+
publish_branch: gh-pages
72+
commit_message: "docs: deploy {sha}"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ examples/frameworks/pylonstest/pylonstest.egg-info/
1616
MANIFEST
1717
nohup.out
1818
setuptools-*
19+
site/
20+
docs/site/

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,15 @@ test:
99
coverage:
1010
venv/bin/python setup.py test --cov
1111

12+
docs:
13+
mkdocs build
14+
15+
docs-serve:
16+
mkdocs serve
17+
1218
clean:
1319
@rm -rf .Python MANIFEST build dist venv* *.egg-info *.egg
1420
@find . -type f -name "*.py[co]" -delete
1521
@find . -type d -name "__pycache__" -delete
1622

17-
.PHONY: build clean coverage test
23+
.PHONY: build clean coverage docs docs-serve test

docs/Makefile

Lines changed: 0 additions & 160 deletions
This file was deleted.

docs/README.rst

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,26 @@ Generate Documentation
44
Requirements
55
------------
66

7-
To generate documentation you need to install:
7+
Install the documentation dependencies with::
88

9-
- Python >= 3.7
10-
- Sphinx (https://www.sphinx-doc.org/)
9+
pip install -r requirements_dev.txt
1110

11+
This provides MkDocs with the Material theme and supporting plugins.
1212

13-
Generate html
14-
-------------
13+
14+
Build static HTML
15+
-----------------
16+
::
17+
18+
mkdocs build
19+
20+
The rendered site is emitted into the ``site/`` directory.
21+
22+
23+
Preview locally
24+
---------------
1525
::
1626

17-
$ make html
27+
mkdocs serve
1828

19-
The command generates html document inside ``build/html`` dir.
29+
This serves the documentation at http://127.0.0.1:8000/ with live reload.

0 commit comments

Comments
 (0)