Skip to content

Commit

Permalink
Add a version menu to the Sphinx build (#394)
Browse files Browse the repository at this point in the history
* Fix warnings in the Sphinx build

* Include the version number in the header

* Enable the version dropdown menu

To make this work, a versions.json file will need to be added to the root of
the gh-pages branch, which is a dict mapping "label": "path" for each version.
This should be updated whenever a new version is tagged.
  • Loading branch information
asmeurer authored May 2, 2022
1 parent 4c134fe commit 3ff72cf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions spec/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
('py:class', 'collections.abc.Sequence'),
('py:class', "Optional[Union[int, float, Literal[inf, - inf, 'fro', 'nuc']]]"),
('py:class', "Union[int, float, Literal[inf, - inf]]"),
('py:obj', "typing.Optional[typing.Union[int, float, typing.Literal[inf, - inf, 'fro', 'nuc']]]"),
('py:obj', "typing.Union[int, float, typing.Literal[inf, - inf]]"),
('py:class', 'PyCapsule'),
('py:class', 'enum.Enum'),
('py:class', 'ellipsis'),
Expand Down Expand Up @@ -123,7 +125,7 @@
html_theme_options = {

# Set the name of the project to appear in the navigation.
'nav_title': 'Python array API standard',
'nav_title': f'Python array API standard {release}',

# Set you GA account ID to enable tracking
#'google_analytics_account': 'UA-XXXXX',
Expand Down Expand Up @@ -170,8 +172,8 @@
#"customization": "Configuration options to personalize your site.",
},

#"version_dropdown": True,
#"version_json": "_static/versions.json",
"version_dropdown": True,
"version_json": "../versions.json",
"table_classes": ["plain"],
}

Expand Down

0 comments on commit 3ff72cf

Please sign in to comment.