Skip to content

Commit 388e65e

Browse files
committed
Add docs build instructions and workflow for GH pages
1 parent 6eaea0e commit 388e65e

3 files changed

Lines changed: 76 additions & 1 deletion

File tree

.github/workflows/build_docs.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch: # Make sure this job can be triggered manually
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
steps:
17+
- uses: actions/checkout@v5
18+
- uses: actions/configure-pages@v3
19+
- uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.13'
22+
- name: Install dependencies
23+
run: |
24+
cd quaddtype/
25+
python -m pip install --upgrade pip
26+
python -m pip install "numpy @ git+https://github.com/numpy/numpy.git" pytest meson meson-python
27+
- name: Build quaddtype package
28+
run: |
29+
cd quaddtype/
30+
python -m pip install . -v --no-build-isolation
31+
- name: Build Sphinx documentation
32+
run: |
33+
cd quaddtype/
34+
python -m pip install ."[docs]"
35+
make -C docs html
36+
- name: Upload artifact
37+
uses: actions/upload-pages-artifact@v3
38+
with:
39+
path: './quaddtype/docs/_build/html'
40+
- name: Deploy to GitHub Pages
41+
id: deployment
42+
uses: actions/deploy-pages@v4

quaddtype/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,36 @@ This is a development feature to help detect threading issues. To build `numpy-q
171171
export LDFLAGS="-fsanitize=thread"
172172
python -m pip install . -vv --no-build-isolation -Csetup-args=-Db_sanitize=thread
173173
```
174+
175+
## Building the documentation
176+
177+
The documentation for the `numpy-quaddtype` package is built using Sphinx. To build the documentation, follow these steps:
178+
179+
1. Install the required dependencies:
180+
181+
```bash
182+
pip install ."[docs]"
183+
```
184+
185+
2. Navigate to the `docs` directory and build the documentation:
186+
187+
```bash
188+
cd docs/
189+
make html
190+
```
191+
192+
3. The generated HTML documentation can be found in the `_build/html` directory within the `docs` folder. Open the `index.html` file in a web browser to view the documentation, or use a local server to serve the files:
193+
194+
```bash
195+
python3 -m http.server --directory _build/html
196+
```
197+
198+
### Serving the documentation
199+
200+
The documentation is automatically built and served using GitHub Pages. Every time changes are pushed to the `main` branch, the documentation is rebuilt and deployed to the `gh-pages` branch of the repository. You can access the documentation at:
201+
202+
```
203+
https://numpy.github.io/numpy-user-dtypes/
204+
```
205+
206+
Check the `.github/workflows/build_docs.yml` file for details.

quaddtype/docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
2727

2828
html_theme = 'pydata_sphinx_theme'
29-
html_static_path = ['_static']
29+

0 commit comments

Comments
 (0)