Skip to content

Commit 41ec6b6

Browse files
authored
Fix docs better (#117)
Signed-off-by: Adam Li <[email protected]>
1 parent 8a997d4 commit 41ec6b6

File tree

5 files changed

+19
-45
lines changed

5 files changed

+19
-45
lines changed

doc/_static/versions.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[
2+
{
3+
"name": "0.2 (devel)",
4+
"version": "dev",
5+
"url": "https://www.pywhy.org/pywhy-graphs/dev/index.html"
6+
},
7+
{
8+
"name": "0.1",
9+
"version": "stable",
10+
"url": "https://www.pywhy.org/pywhy-graphs/stable/index.html"
11+
}
12+
]

doc/_templates/docs-navbar.html

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

doc/_templates/docs-toc.html

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

doc/_templates/version-switcher.html

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

doc/conf.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
copyright = f"{datetime.today().year}, Adam Li"
3737
author = "Adam Li"
3838
version = pywhy_graphs.__version__
39+
release = version
3940

4041
# -- General configuration ---------------------------------------------------
4142

@@ -270,6 +271,7 @@ def setup(app):
270271
html_css_files = ["css/custom.css"]
271272
html_favicon = "_static/favicon_url.ico"
272273

274+
switcher_version_match = "dev" if "dev" in release else version
273275
html_theme_options = {
274276
"icon_links": [
275277
dict(
@@ -281,7 +283,11 @@ def setup(app):
281283
"use_edit_page_button": False,
282284
"navigation_with_keys": False,
283285
"show_toc_level": 1,
284-
"navbar_end": ["version-switcher", "navbar-icon-links"],
286+
"navbar_end": ["theme-switcher", "version-switcher", "navbar-icon-links"],
287+
"switcher": {
288+
"json_url": "https://raw.githubusercontent.com/neurodata/treeple/main/doc/_static/versions.json", # noqa: E501
289+
"version_match": switcher_version_match,
290+
},
285291
}
286292

287293
scrapers = ("matplotlib",)

0 commit comments

Comments
 (0)