Skip to content

Commit acfacac

Browse files
antazoeyfubuloubu
andauthored
docs: use new documentation builder and layout (#111)
* docs: new docs * docs: correct action * docs: del token env setup-py * docs: contributing update * chore: sp --------- Co-authored-by: El De-dog-lo <3859395+fubuloubu@users.noreply.github.com>
1 parent d10f01f commit acfacac

File tree

11 files changed

+52
-812
lines changed

11 files changed

+52
-812
lines changed

.github/workflows/docs.yaml

Lines changed: 20 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,29 @@
11
name: Docs
22

33
on:
4-
push:
5-
branches: [main]
6-
release:
7-
types: [released]
8-
pull_request:
9-
types: [opened, synchronize]
4+
push:
5+
branches: [main]
6+
release:
7+
types: [released]
8+
pull_request:
9+
types: [opened, synchronize]
1010

1111
jobs:
12-
docs:
13-
runs-on: ubuntu-latest
14-
permissions:
15-
contents: write
12+
docs:
13+
runs-on: ubuntu-latest
1614

17-
steps:
18-
- uses: actions/checkout@v3
15+
permissions:
16+
contents: write
1917

20-
- name: Setup Python
21-
uses: actions/setup-python@v4
22-
with:
23-
python-version: "3.10"
18+
steps:
19+
- uses: actions/checkout@v4
2420

25-
- name: Install Dependencies
26-
run: |
27-
python -m pip install --upgrade pip
28-
pip install .[doc]
21+
- name: Setup Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: "3.10"
2925

30-
- name: Build HTML artifact
31-
run: python build_docs.py
32-
33-
- name: Upload HTML artifact
34-
uses: actions/upload-artifact@v3
35-
with:
36-
name: DocumentationHTML
37-
path: docs/_build/silverback
38-
39-
- name: Commit and publish documentation changes to gh-pages branch
40-
run: |
41-
if [[ "${GITHUB_EVENT_NAME}" =~ "pull_request" ]]; then
42-
echo "skipping 'git commit' step for PR"
43-
else
44-
git clone https://github.com/${GITHUB_REPOSITORY} --branch gh-pages --single-branch gh-pages
45-
cp -r docs/_build/silverback/* gh-pages/
46-
cd gh-pages
47-
touch .nojekyll
48-
git config --local user.email "action@github.com"
49-
git config --local user.name "GitHub Action"
50-
git add .
51-
git commit -m "Update documentation" -a || true
52-
fi
53-
- name: Push changes
54-
uses: ad-m/github-push-action@master
55-
if: ${{ github.event_name != 'pull_request' }}
56-
with:
57-
branch: gh-pages
58-
directory: gh-pages
59-
github_token: ${{ secrets.GITHUB_TOKEN }}
26+
- name: Ape Docs
27+
uses: apeworx/sphinx-ape@main
28+
with:
29+
github-token: ${{ secrets.GITHUB_TOKEN }}

CONTRIBUTING.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,34 @@ pre-commit install
3232

3333
Committing will now automatically run the local hooks and ensure that your commit passes all lint checks.
3434

35+
## Running the docs locally
36+
37+
First, make sure you have the docs-related tooling installed:
38+
39+
```bash
40+
pip install -e .'[doc]'
41+
```
42+
43+
Then, run the following from the root project directory:
44+
45+
```bash
46+
sphinx-ape build .
47+
```
48+
49+
For the best viewing experience, use a local server:
50+
51+
```bash
52+
sphinx-ape serve .
53+
```
54+
55+
Then, open your browser to `127.0.0.1:1337` and click the `ape` directory link.
56+
57+
You can also use the `--open` flag to automatically open the docs:
58+
59+
```bash
60+
sphinx-ape serve . --open
61+
```
62+
3563
## Pull Requests
3664

3765
Pull requests are welcomed! Please adhere to the following:

0 commit comments

Comments
 (0)