Skip to content

Commit 4612a90

Browse files
Add mike doc versioning support
1 parent 7275900 commit 4612a90

File tree

3 files changed

+33
-4
lines changed

3 files changed

+33
-4
lines changed

Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,23 @@ showdoc: site/index.html
176176

177177
showdocs: showdoc
178178

179+
doc-deploy:
180+
$(CONDA_RUN) mike deploy -F $(MKDOC_CONFIG) -u $(VERSION) latest
181+
$(CONDA_RUN) mike set-default -F $(MKDOC_CONFIG) latest
182+
183+
mike-deploy: doc-deploy
184+
mike-build: doc-deploy
185+
186+
doc-push:
187+
git push origin gh-pages
188+
189+
doc-upload: doc-push
190+
191+
doc-serve-all:
192+
$(CONDA_RUN) mike serve -F $(MKDOC_CONFIG)
193+
194+
mike-serve: doc-serve-all
195+
179196
check-upload:
180197
$(CONDA_RUN) twine check $(WHEEL_FILE)
181198

environment.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ dependencies:
1717
- mkdocs-material >=8.2
1818
- beautifulsoup4 >=4.12
1919
# documentation
20-
- black
21-
- mkdocs >=1.3.0
22-
- pymdown-extensions
23-
- mkdocs-material >=8.2
20+
- black >=23.7
21+
- mike >=1.1,<2.0
22+
- mkdocs >=1.5.0,<2.0
23+
- mkdocs-material >=9.1
2424
- linkchecker >=10.2.1

mkdocs.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ theme:
4646
icon: material/weather-night
4747
name: Switch to light mode
4848

49+
extra:
50+
generator: false
51+
version:
52+
provider: mike
53+
default: stable
54+
4955
markdown_extensions:
5056
- admonition
5157
- pymdownx.snippets:
@@ -56,6 +62,12 @@ markdown_extensions:
5662

5763
plugins:
5864
- search
65+
- mike:
66+
# These fields are all optional; the defaults are as below...
67+
canonical_version: stable
68+
version_selector: true
69+
css_dir: css
70+
javascript_dir: js
5971
- mkdocstrings:
6072
default_handler: python_xref
6173
handlers:

0 commit comments

Comments
 (0)