Skip to content

Commit a6b83aa

Browse files
committed
use quarto project profiles
1 parent 578f644 commit a6b83aa

9 files changed

Lines changed: 46 additions & 12 deletions

File tree

.github/workflows/docs.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,30 @@ jobs:
2525
uses: quarto-dev/quarto-actions/setup@v2
2626
- name: build docs
2727
run: |
28-
make docs
28+
make docs-latest
2929
- name: save docs
3030
uses: actions/upload-artifact@v3
3131
with:
3232
name: docs-html
3333
path: docs/_site/
34+
- name: publish dev docs
35+
if: github.ref_name == 'main' && github.ref_type == 'branch'
36+
run: |
37+
make docs-
3438
- name: publish dev docs
3539
if: github.ref_name == 'main' && github.ref_type == 'branch'
3640
uses: peaceiris/actions-gh-pages@v3
3741
with:
3842
github_token: ${{ secrets.GITHUB_TOKEN }}
39-
publish_dir: docs/_site/*
43+
publish_dir: docs/latest/*
4044
publish_branch: gh-pages
4145
destination_dir: main
4246
- name: publish stable docs
4347
if: github.ref_type == 'tag' && startswith(github.ref, 'refs/tags/v')
4448
uses: peaceiris/actions-gh-pages@v3
4549
with:
4650
github_token: ${{ secrets.GITHUB_TOKEN }}
47-
publish_dir: docs/_site/*
51+
publish_dir: docs/stable/*
4852
publish_branch: gh-pages
4953
destination_dir: ${{ github.ref_name }}
5054
- name: create symlink stable to new version

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,13 @@ coverage:
6060
coverage html
6161
$(BROWSER) htmlcov/index.html
6262

63-
docs doc documentation:
64-
$(MAKE) -C docs clean
63+
docs doc documentation: docs-latest docs-stable
64+
65+
docs-latest:
66+
$(MAKE) -C docs latest
67+
68+
docs-stable:
69+
$(MAKE) -C docs stable
6570

6671
release: dist
6772
twine upload dist/*

docs/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
/objects.json
44
/_sidebar.yml
55
/reference
6+
/latest
7+
/stable

docs/Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
# Minimal makefile for quartodoc documentation
22

3-
.PHONY: help Makefile
3+
.PHONY: help Makefile stable latest
44

55
# Catch-all target:
66
%: Makefile
7+
8+
9+
latest:
10+
python version_config.py
11+
python -m quartodoc build
12+
python -m quartodoc interlinks
13+
quarto render --profile latest
14+
15+
stable:
16+
python version_config.py
717
python -m quartodoc build
818
python -m quartodoc interlinks
919
quarto render

docs/_environment

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
LATEST=0.2.0.post10+g578f644.d20230213
2+
STABLE=0.2.0

docs/_quarto-latest.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
project:
2+
title: "Vetiver {{< env VERSION >}}"
3+
output-dir: stable

docs/_quarto-stable.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
project:
2+
title: "Vetiver {{< env VERSION >}}"
3+
output-dir: stable

docs/_quarto.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
project:
22
type: website
3-
output-dir: _site
3+
pre-render: prepare.py
44

55
website:
6-
title: "Vetiver for Python"
6+
title: "Vetiver {{< env VERSION >}}"
77
description: "Version, share, deploy, and monitor your Python models"
88
repo-url: https://github.com/rstudio/vetiver-python
99
repo-actions: [edit, issue]
@@ -76,10 +76,6 @@ quartodoc:
7676
- StatsmodelsHandler
7777
- XGBoostHandler
7878

79-
# - title: "Advanced Usage"
80-
# contents:
81-
#
82-
8379
metadata-files:
8480
- _sidebar.yml
8581

@@ -89,6 +85,9 @@ filters:
8985
interlinks:
9086
sources: {}
9187

88+
profile:
89+
default: latest
90+
9291
format:
9392
html:
9493
theme: sandstone

docs/version_config.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from importlib_metadata import version as _version
2+
3+
v = f"""VERSION={_version('vetiver')}"""
4+
5+
f = open("_environment", "w")
6+
f.write(v)

0 commit comments

Comments
 (0)