Skip to content

Commit cbc1b0d

Browse files
authored
Add Great Docs site (including workflow file) (#11)
* Create user guide article .qmd files * Move benchmarks.qmd to dedicated directory * Delete _quarto.yml * Remove docs directory * Add Great Docs config file * Add docs dir with .gitignore and _quarto.yml * Create docs.yml * Ensure that Great Docs is installed in workflow * Update docs workflow to use maturin for build * Update docs workflow to build and install wheel * Update tag assertion in YAML parsing example * Update .gitignore * Remove generated Quarto docs files * Delete mkdocs.yml * Delete 10-reference.qmd * Switch docs build to great-docs * Rename Source URL to Repository * Update great-docs.yml config * Create 00-index.qmd * Update contributing guide: Great Docs & tests * Update docs workflow to use great-docs/_site * Revise User Guide intro and update links
1 parent 510b493 commit cbc1b0d

24 files changed

+329
-1048
lines changed

.github/workflows/docs.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: CI Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
build-docs:
11+
name: "Build Docs"
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.11"
19+
20+
- name: Build and install package
21+
uses: PyO3/maturin-action@v1
22+
with:
23+
command: build
24+
args: --release --out dist
25+
sccache: true
26+
27+
- name: Install package and documentation dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
python -m pip install dist/*.whl
31+
python -m pip install git+https://github.com/rich-iannone/great-docs.git
32+
python -m pip install quartodoc jupyter
33+
34+
- name: Set up Quarto
35+
uses: quarto-dev/quarto-actions/setup@v2
36+
37+
- name: Build docs
38+
run: great-docs build
39+
40+
- name: Save docs artifact
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: docs-html
44+
path: great-docs/_site
45+
46+
publish-docs:
47+
name: "Publish Docs"
48+
runs-on: ubuntu-latest
49+
needs: "build-docs"
50+
if: github.ref == 'refs/heads/main'
51+
permissions:
52+
pages: write
53+
id-token: write
54+
environment:
55+
name: github-pages
56+
url: ${{ steps.deployment.outputs.page_url }}
57+
steps:
58+
- uses: actions/download-artifact@v4
59+
with:
60+
name: docs-html
61+
path: great-docs/_site
62+
63+
- name: Upload Pages artifact
64+
uses: actions/upload-pages-artifact@v3
65+
with:
66+
path: great-docs/_site
67+
68+
- name: Deploy to GitHub Pages
69+
id: deployment
70+
uses: actions/deploy-pages@v4
71+
72+
preview-docs:
73+
name: "Preview Docs"
74+
runs-on: ubuntu-latest
75+
needs: "build-docs"
76+
if: github.event_name == 'pull_request'
77+
permissions:
78+
deployments: write
79+
pull-requests: write
80+
steps:
81+
- uses: actions/download-artifact@v4
82+
with:
83+
name: docs-html
84+
path: great-docs/_site
85+
86+
# Start deployment
87+
- name: Configure pull release name
88+
if: ${{ github.event_name == 'pull_request' }}
89+
run: |
90+
echo "RELEASE_NAME=pr-${PR_NUMBER}" >> $GITHUB_ENV
91+
env:
92+
PR_NUMBER: ${{ github.event.number }}
93+
94+
- name: Configure branch release name
95+
if: ${{ github.event_name != 'pull_request' }}
96+
run: |
97+
# use branch name, but replace slashes. E.g. feat/a -> feat-a
98+
echo "RELEASE_NAME=${GITHUB_REF_NAME/\//-}" >> $GITHUB_ENV
99+
100+
# Deploy
101+
- name: Create Github Deployment
102+
uses: bobheadxi/deployments@v1
103+
id: deployment
104+
if: ${{ !github.event.pull_request.head.repo.fork }}
105+
with:
106+
step: start
107+
token: ${{ secrets.GITHUB_TOKEN }}
108+
env: ${{ env.RELEASE_NAME }}
109+
ref: ${{ github.head_ref }}
110+
transient: true
111+
logs: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,6 @@ site/
7777

7878
/.quarto/
7979
**/*.quarto_ipynb
80+
81+
# Great Docs build directory (ephemeral)
82+
great-docs/

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,11 @@ assert round_tripped == obj
142142

143143
Online docs: https://posit-dev.github.io/py-yaml12/
144144

145-
- Guides: `docs/usage.md` (basics) and `docs/tags.md` (advanced tags,
146-
anchors, streams).
147-
- Reference: `docs/reference/`.
148-
- API overview: `docs/api.md`.
149-
150145
To build or serve the docs locally:
151146

152147
```bash
153-
.venv/bin/mkdocs build # or: .venv/bin/mkdocs serve
148+
pip install git+https://github.com/rich-iannone/great-docs.git
149+
great-docs build # or: great-docs preview
154150
```
155151

156152
## Tests

_quarto.yml

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

docs/api.md

Lines changed: 0 additions & 12 deletions
This file was deleted.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)