Skip to content

Commit

Permalink
Fix docs better (#117)
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Li <[email protected]>
  • Loading branch information
adam2392 authored Jul 18, 2024
1 parent 8a997d4 commit 41ec6b6
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 45 deletions.
12 changes: 12 additions & 0 deletions doc/_static/versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"name": "0.2 (devel)",
"version": "dev",
"url": "https://www.pywhy.org/pywhy-graphs/dev/index.html"
},
{
"name": "0.1",
"version": "stable",
"url": "https://www.pywhy.org/pywhy-graphs/stable/index.html"
}
]
20 changes: 0 additions & 20 deletions doc/_templates/docs-navbar.html

This file was deleted.

13 changes: 0 additions & 13 deletions doc/_templates/docs-toc.html

This file was deleted.

11 changes: 0 additions & 11 deletions doc/_templates/version-switcher.html

This file was deleted.

8 changes: 7 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
copyright = f"{datetime.today().year}, Adam Li"
author = "Adam Li"
version = pywhy_graphs.__version__
release = version

# -- General configuration ---------------------------------------------------

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

switcher_version_match = "dev" if "dev" in release else version
html_theme_options = {
"icon_links": [
dict(
Expand All @@ -281,7 +283,11 @@ def setup(app):
"use_edit_page_button": False,
"navigation_with_keys": False,
"show_toc_level": 1,
"navbar_end": ["version-switcher", "navbar-icon-links"],
"navbar_end": ["theme-switcher", "version-switcher", "navbar-icon-links"],
"switcher": {
"json_url": "https://raw.githubusercontent.com/neurodata/treeple/main/doc/_static/versions.json", # noqa: E501
"version_match": switcher_version_match,
},
}

scrapers = ("matplotlib",)
Expand Down

0 comments on commit 41ec6b6

Please sign in to comment.