Skip to content

Commit 5fdd911

Browse files
Merge pull request #233 from matthewwardrop/add_documentation_versioning
2 parents ae9e5d0 + 9272929 commit 5fdd911

File tree

7 files changed

+156
-72
lines changed

7 files changed

+156
-72
lines changed

.github/workflows/publish.yml

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,30 @@ on:
55
tags:
66
- "v*"
77

8+
permissions:
9+
contents: write
10+
811
jobs:
912
deploy:
1013
runs-on: ubuntu-latest
1114
steps:
12-
- uses: actions/checkout@v1
13-
- name: Set up Python
14-
uses: actions/setup-python@v1
15-
with:
16-
python-version: '3.9'
17-
- name: Install dependencies
18-
run: |
19-
python -m pip install --upgrade pip
20-
pip install hatch
21-
- name: Build and publish
22-
env:
23-
HATCH_INDEX_USER: __token__
24-
HATCH_INDEX_AUTH: ${{ secrets.PYPI_PUBLISH_TOKEN }}
25-
run: |
26-
hatch build
27-
hatch publish
15+
- uses: actions/checkout@v1
16+
- name: Set up Python
17+
uses: actions/setup-python@v1
18+
with:
19+
python-version: "3.9"
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install hatch
24+
- name: Build and publish
25+
env:
26+
HATCH_INDEX_USER: __token__
27+
HATCH_INDEX_AUTH: ${{ secrets.PYPI_PUBLISH_TOKEN }}
28+
run: |
29+
hatch build
30+
hatch publish
31+
- name: Build and deploy docs
32+
run: |
33+
VERSION=$(echo "${{ github.ref_name }}" | sed -E s/\.[0-9]+$/\.x/)
34+
hatch run docs:deploy "$VERSION" latest

.github/workflows/publish_docs.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- main
77

88
permissions:
9-
contents: write
9+
contents: write
1010

1111
jobs:
1212
build:
@@ -29,7 +29,11 @@ jobs:
2929
path: .cache
3030
restore-keys: |
3131
mkdocs-material-
32+
- name: Install hatch
33+
run: |
34+
python -m pip install --upgrade pip
35+
pip install hatch
3236
- name: Build and Deploy docs.
3337
run: |
34-
pip install -r docsite/requirements.txt
35-
mkdocs gh-deploy -v --config-file docsite/mkdocs.yml --force
38+
git pull origin gh-pages
39+
hatch run docs:deploy dev

docsite/mkdocs.yml

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
site_name: Formulaic
22
nav:
33
- Getting Started:
4-
- Introduction: index.md
5-
- What are formulas?: formulas.md
6-
- Installation: installation.md
7-
- Migrating from Patsy/R: migration.md
8-
- Changelog: changelog.md
4+
- Introduction: index.md
5+
- What are formulas?: formulas.md
6+
- Installation: installation.md
7+
- Migrating from Patsy/R: migration.md
8+
- Changelog: changelog.md
99
- User Guides:
10-
- Introduction: guides/index.md
11-
- Quickstart: guides/quickstart.ipynb
12-
- How it works: guides/formulae.ipynb
13-
- Handling Missing Data: guides/missing_data.ipynb
14-
- Formula Grammar: guides/grammar.md
15-
- Model Specs: guides/model_specs.ipynb
16-
- Transforms: guides/transforms.ipynb
17-
- Categorical Encoding: guides/contrasts.ipynb
18-
- Spline Encoding: guides/splines.ipynb
19-
- Using with existing libraries: guides/integration.ipynb
10+
- Introduction: guides/index.md
11+
- Quickstart: guides/quickstart.ipynb
12+
- How it works: guides/formulae.ipynb
13+
- Handling Missing Data: guides/missing_data.ipynb
14+
- Formula Grammar: guides/grammar.md
15+
- Model Specs: guides/model_specs.ipynb
16+
- Transforms: guides/transforms.ipynb
17+
- Categorical Encoding: guides/contrasts.ipynb
18+
- Spline Encoding: guides/splines.ipynb
19+
- Using with existing libraries: guides/integration.ipynb
2020
- Developer Guides:
21-
- Introduction: dev/index.md
22-
- Integration: dev/integration.md
23-
- Extensions: dev/extensions.md
21+
- Introduction: dev/index.md
22+
- Integration: dev/integration.md
23+
- Extensions: dev/extensions.md
2424
theme:
2525
name: material
2626
font:
@@ -45,3 +45,7 @@ plugins:
4545
- mkdocs-jupyter
4646
extra_css:
4747
- assets/styles.css
48+
extra:
49+
version:
50+
alias: true
51+
provider: mike

docsite/overrides/base.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{% extends "base.html" %}
2+
3+
{% block outdated %}
4+
This documentation is for an older version of Formulaic.
5+
<a href="{{ '../' ~ base_url }}">
6+
<strong>Click here to go to latest version.</strong>
7+
</a>
8+
{% endblock %}

docsite/requirements.in

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

docsite/requirements.txt renamed to docsite/requirements.lock

Lines changed: 73 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.10
3-
# by the following command:
2+
# This file is autogenerated by hatch-pip-compile with Python 3.12
43
#
5-
# pip-compile --output-file=requirements.txt requirements.in
4+
# - mike
5+
# - mkdocs
6+
# - mkdocs-jupyter
7+
# - mkdocs-material
8+
# - mkdocs-material-extensions
9+
# - pymdown-extensions
10+
# - pygments
11+
# - astor>=0.8; python_version < "3.9"
12+
# - cached-property>=1.3.0; python_version < "3.8"
13+
# - graphlib-backport>=1.0.0; python_version < "3.9"
14+
# - interface-meta>=1.2.0
15+
# - numpy>=1.16.5
16+
# - pandas>=1.0
17+
# - scipy>=1.6
18+
# - typing-extensions>=4.2.0
19+
# - wrapt>=1.0; python_version < "3.13"
20+
# - wrapt>=1.17.0rc1; python_version >= "3.13"
621
#
722

8-
asttokens==2.4.1
23+
asttokens==3.0.0
924
# via stack-data
1025
attrs==24.2.0
1126
# via
@@ -17,7 +32,7 @@ beautifulsoup4==4.12.3
1732
# via nbconvert
1833
bleach==6.2.0
1934
# via nbconvert
20-
certifi==2024.8.30
35+
certifi==2024.12.14
2136
# via requests
2237
charset-normalizer==3.4.0
2338
# via requests
@@ -27,30 +42,35 @@ colorama==0.4.6
2742
# via mkdocs-material
2843
comm==0.2.2
2944
# via ipykernel
30-
debugpy==1.8.8
45+
debugpy==1.8.11
3146
# via ipykernel
3247
decorator==5.1.1
3348
# via ipython
3449
defusedxml==0.7.1
3550
# via nbconvert
36-
exceptiongroup==1.2.2
37-
# via ipython
3851
executing==2.1.0
3952
# via stack-data
40-
fastjsonschema==2.20.0
53+
fastjsonschema==2.21.1
4154
# via nbformat
4255
ghp-import==2.1.0
4356
# via mkdocs
4457
idna==3.10
4558
# via requests
59+
importlib-metadata==8.5.0
60+
# via mike
61+
importlib-resources==6.4.5
62+
# via mike
63+
interface-meta==1.3.0
64+
# via hatch.envs.docs
4665
ipykernel==6.29.5
4766
# via mkdocs-jupyter
48-
ipython==8.29.0
67+
ipython==8.30.0
4968
# via ipykernel
5069
jedi==0.19.2
5170
# via ipython
5271
jinja2==3.1.4
5372
# via
73+
# mike
5474
# mkdocs
5575
# mkdocs-material
5676
# nbconvert
@@ -71,7 +91,7 @@ jupyter-core==5.7.2
7191
# nbformat
7292
jupyterlab-pygments==0.3.0
7393
# via nbconvert
74-
jupytext==1.16.4
94+
jupytext==1.16.5
7595
# via mkdocs-jupyter
7696
markdown==3.7
7797
# via
@@ -99,26 +119,29 @@ mergedeep==1.3.4
99119
# via
100120
# mkdocs
101121
# mkdocs-get-deps
122+
mike==2.1.3
123+
# via hatch.envs.docs
102124
mistune==3.0.2
103125
# via nbconvert
104126
mkdocs==1.6.1
105127
# via
106-
# -r requirements.in
128+
# hatch.envs.docs
129+
# mike
107130
# mkdocs-jupyter
108131
# mkdocs-material
109132
mkdocs-get-deps==0.2.0
110133
# via mkdocs
111134
mkdocs-jupyter==0.25.1
112-
# via -r requirements.in
113-
mkdocs-material==9.5.44
135+
# via hatch.envs.docs
136+
mkdocs-material==9.5.48
114137
# via
115-
# -r requirements.in
138+
# hatch.envs.docs
116139
# mkdocs-jupyter
117140
mkdocs-material-extensions==1.3.1
118141
# via
119-
# -r requirements.in
142+
# hatch.envs.docs
120143
# mkdocs-material
121-
nbclient==0.10.0
144+
nbclient==0.10.1
122145
# via nbconvert
123146
nbconvert==7.16.4
124147
# via mkdocs-jupyter
@@ -129,6 +152,11 @@ nbformat==5.10.4
129152
# nbconvert
130153
nest-asyncio==1.6.0
131154
# via ipykernel
155+
numpy==2.2.0
156+
# via
157+
# hatch.envs.docs
158+
# pandas
159+
# scipy
132160
packaging==24.2
133161
# via
134162
# ipykernel
@@ -137,6 +165,8 @@ packaging==24.2
137165
# nbconvert
138166
paginate==0.5.7
139167
# via mkdocs-material
168+
pandas==2.2.3
169+
# via hatch.envs.docs
140170
pandocfilters==1.5.1
141171
# via nbconvert
142172
parso==0.8.4
@@ -159,28 +189,36 @@ pure-eval==0.2.3
159189
# via stack-data
160190
pygments==2.18.0
161191
# via
162-
# -r requirements.in
192+
# hatch.envs.docs
163193
# ipython
164194
# mkdocs-jupyter
165195
# mkdocs-material
166196
# nbconvert
167197
pymdown-extensions==10.12
168198
# via
169-
# -r requirements.in
199+
# hatch.envs.docs
170200
# mkdocs-material
201+
pyparsing==3.2.0
202+
# via mike
171203
python-dateutil==2.9.0.post0
172204
# via
173205
# ghp-import
174206
# jupyter-client
207+
# pandas
208+
pytz==2024.2
209+
# via pandas
175210
pyyaml==6.0.2
176211
# via
177212
# jupytext
213+
# mike
178214
# mkdocs
179215
# mkdocs-get-deps
180216
# pymdown-extensions
181217
# pyyaml-env-tag
182218
pyyaml-env-tag==0.1
183-
# via mkdocs
219+
# via
220+
# mike
221+
# mkdocs
184222
pyzmq==26.2.0
185223
# via
186224
# ipykernel
@@ -193,23 +231,21 @@ regex==2024.11.6
193231
# via mkdocs-material
194232
requests==2.32.3
195233
# via mkdocs-material
196-
rpds-py==0.21.0
234+
rpds-py==0.22.3
197235
# via
198236
# jsonschema
199237
# referencing
200-
six==1.16.0
201-
# via
202-
# asttokens
203-
# python-dateutil
238+
scipy==1.14.1
239+
# via hatch.envs.docs
240+
six==1.17.0
241+
# via python-dateutil
204242
soupsieve==2.6
205243
# via beautifulsoup4
206244
stack-data==0.6.3
207245
# via ipython
208246
tinycss2==1.4.0
209247
# via nbconvert
210-
tomli==2.1.0
211-
# via jupytext
212-
tornado==6.4.1
248+
tornado==6.4.2
213249
# via
214250
# ipykernel
215251
# jupyter-client
@@ -225,9 +261,13 @@ traitlets==5.14.3
225261
# nbconvert
226262
# nbformat
227263
typing-extensions==4.12.2
228-
# via ipython
264+
# via hatch.envs.docs
265+
tzdata==2024.2
266+
# via pandas
229267
urllib3==2.2.3
230268
# via requests
269+
verspec==0.1.0
270+
# via mike
231271
watchdog==6.0.0
232272
# via mkdocs
233273
wcwidth==0.2.13
@@ -236,3 +276,7 @@ webencodings==0.5.1
236276
# via
237277
# bleach
238278
# tinycss2
279+
wrapt==1.17.0 ; python_version < "3.13"
280+
# via hatch.envs.docs
281+
zipp==3.21.0
282+
# via importlib-metadata

0 commit comments

Comments
 (0)