You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When opening any built page on RTD with this theme, the switcher menu shows "Choose version" instead of the selected version. I largely followed the conf.py for this repo, especially after reading #1512.
From what I can see, my tags and settings are fairly standard, the only difference is that I dynamically load
name, author, copyright, release and version from .pyproject.toml and .bump_my_version.toml. But I added print statements and the build log shows these values are initialized correctly (version == release == 0.0.7 on stable, for example).
My versioning scheme follows semver, and works as follows: x.y.z-alphaN, x.y.z-betaN, x.y.z-rcN, x.y.z
conf.py
# Configuration file for the Sphinx documentation builder.## For the full list of built-in configuration values, see the documentation:# https://www.sphinx-doc.org/en/master/usage/configuration.htmlimportdatetimeimportosimportsysfrompathlibimportPathimporttomlsys.path.insert(0, os.path.abspath('../'))
# -- Project information -----------------------------------------------------pyproject_toml_dict: dict=toml.load(
Path(__file__).parents[1] /"pyproject.toml")
project_dict: dict=pyproject_toml_dict["project"]
project=project_dict["name"]
_authors: list[dict] =project_dict["authors"]
author: str=", ".join([f"{a['name']} <{a['email']}>"forain_authors])
copyright: str=f'{datetime.datetime.now().year}, {author}'bumpversion_toml=toml.load(Path(__file__).parents[1] /".bumpversion.toml")
release: str=bumpversion_toml["tool"]["bumpversion"]["current_version"] # e.g., this becomes 0.0.7 on stableversion: str=releaseprint(version)
# -- General configuration ---------------------------------------------------extensions= [
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
'sphinx.ext.coverage',
'sphinx.ext.doctest',
'sphinx.ext.mathjax',
]
templates_path= ['_templates']
exclude_patterns= ['_build', 'Thumbs.db', '.DS_Store']
# -- Options for HTML output -------------------------------------------------version_match=os.environ.get("READTHEDOCS_VERSION")
ifnotversion_matchorversion_match.isdigit() orversion_match=="latest":
# For local development, infer the version to match from the package.if'-'inrelease:
version_match="dev"json_url="_static/switcher.json"else:
version_match=releaseelifversion_match=="stable":
version_match=releasehtml_theme='pydata_sphinx_theme'html_static_path= ['_static']
json_url="https://impart.readthedocs.io/en/latest/_static/switcher.json"html_theme_options= {
"switcher": {
"version_match": version_match,
"json_url": json_url,
},
"footer_start": [
"version-switcher"
],
"show_version_warning_banner": True,
}
html_show_sourcelink=Falsehtml_title=f"{project}{release}"
And this is my switcher.json, located in docs/_static/:
I've gone ahead and updated to 0.15.3, which fixed the issue! 🥳
The switcher now shows the correct version in the preview.
As a side note, the vertical cyan bar to indicate the currently selected version when the switcher is expanded seems to work only sometimes. For me, it will often disappear after reloading the page. But that's another issue.
Anyways, thanks for the update!
Closing as resolved.
when looking into the cause of #1829 I found a couple cases where
`document.querySelector` might be `null` and we don't handle that very
gracefully.
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Related to: #1681, #1500, #1512
When opening any built page on RTD with this theme, the switcher menu shows "Choose version" instead of the selected version. I largely followed the
conf.py
for this repo, especially after reading #1512.From what I can see, my tags and settings are fairly standard, the only difference is that I dynamically load
name, author, copyright, release and version from
.pyproject.toml
and.bump_my_version.toml
. But I added print statements and the build log shows these values are initialized correctly (version == release == 0.0.7 on stable, for example).My versioning scheme follows semver, and works as follows: x.y.z-alphaN, x.y.z-betaN, x.y.z-rcN, x.y.z
conf.py
And this is my
switcher.json
, located indocs/_static/
:I see the following when opening the stable page the first time after building:
After reloading the page, or clicking on 0.0.7 (stable), it looks like this (and remains like this for consecutive page visits):
Any help is appreciated!
The text was updated successfully, but these errors were encountered: