Skip to content

Commit

Permalink
Remove version switcher from navbar
Browse files Browse the repository at this point in the history
* Remove version switcher since it needs to be updated by hand every time
a new version is released

* Remove now-obsolete ``docs/_static/switcher.json``

* Remove ``jinja2`` dependency from ``environment.yml``
  • Loading branch information
aknierim committed Jul 17, 2023
1 parent beb5fad commit 02798cb
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 104 deletions.
72 changes: 0 additions & 72 deletions docs/_static/switcher.json

This file was deleted.

32 changes: 1 addition & 31 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,32 +190,8 @@ def setup(app):
todo_include_todos = True


# -- Version switcher -----------------------------------------------------

# Define the json_url for our version switcher.
json_url = "https://ctapipe.readthedocs.io/en/latest/_static/switcher.json"

# Define the version we use for matching in the version switcher.
version_match = os.environ.get("READTHEDOCS_VERSION")
# If READTHEDOCS_VERSION doesn't exist, we're not on RTD
# If it is an integer, we're in a PR build and the version isn't correct.
if not version_match or version_match.isdigit():
# For local development, infer the version to match from the package.
release = ctapipe.__version__
if "dev" in release or "rc" in release:
version_match = "latest"
# We want to keep the relative reference if we are in dev mode
# but we want the whole url if we are effectively in a released version
json_url = "_static/switcher.json"
else:
version_match = release


# -- Options for HTML output ----------------------------------------------

# on_rtd is whether we are on readthedocs.org
on_rtd = os.environ.get("READTHEDOCS", None) == "True"

html_theme = "pydata_sphinx_theme"


Expand All @@ -224,7 +200,6 @@ def setup(app):
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
html_theme_options = {
"logo": {
"image_light": "ctapipe_logo.webp",
Expand All @@ -233,11 +208,7 @@ def setup(app):
},
"github_url": "https://github.com/cta-observatory/ctapipe",
"header_links_before_dropdown": 6,
"navbar_start": ["navbar-logo", "version-switcher"],
"switcher": {
"version_match": version_match,
"json_url": json_url,
},
"navbar_start": ["navbar-logo"],
"use_edit_page_button": True,
"icon_links": [
{
Expand All @@ -253,7 +224,6 @@ def setup(app):
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ['_static']
html_static_path = ["_static"]
html_context = {
"default_mode": "light",
Expand Down
1 change: 0 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,4 @@ dependencies:
- zlib
- zstandard
- eventio>=1.9.1
- jinja2
- ffmpeg # for making movies in the documentation

0 comments on commit 02798cb

Please sign in to comment.