Skip to content

Commit

Permalink
Fix language toggle for docs (#504) (#509)
Browse files Browse the repository at this point in the history
* Fix language toggle for docs

* Fix copyright

---------

Co-authored-by: Takashi Imamichi <[email protected]>
(cherry picked from commit 3349304)

Co-authored-by: Eric Arellano <[email protected]>
  • Loading branch information
mergify[bot] and Eric-Arellano authored May 10, 2023
1 parent 2df28e0 commit dfdfa66
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 42 deletions.
14 changes: 0 additions & 14 deletions docs/_templates/page.html

This file was deleted.

24 changes: 0 additions & 24 deletions docs/_templates/versions.html

This file was deleted.

1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
"sphinx.ext.doctest",
"nbsphinx",
"sphinx.ext.intersphinx",
"qiskit_sphinx_theme",
]
html_static_path = ["_static"]
templates_path = ["_templates"]
Expand Down
6 changes: 3 additions & 3 deletions docs/versionutils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2022.
# (C) Copyright IBM 2022, 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
Expand Down Expand Up @@ -46,7 +46,7 @@ def _extend_html_context(app, config):
context["translations_list"] = translations_list
context["current_translation"] = _get_current_translation(config) or config.language
context["translation_url"] = partial(_get_translation_url, config)
context["version_label"] = _get_version_label(config)
context["language_label"] = _get_language_label(config)


def _get_current_translation(config):
Expand All @@ -63,7 +63,7 @@ def _get_translation_url(config, code, pagename):
return _get_url(config, base, pagename)


def _get_version_label(config):
def _get_language_label(config):
return "%s" % (_get_current_translation(config) or config.language,)


Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ qiskit-aer>=0.11
mypy>=0.981
mypy-extensions>=0.4.3
nbsphinx
qiskit_sphinx_theme>=1.10.*
qiskit_sphinx_theme~=1.11.1
5 changes: 5 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,13 @@ commands =
coverage3 report

[testenv:docs]
# Editable mode breaks macOS: https://github.com/sphinx-doc/sphinx/issues/10943
usedevelop = False
envdir = .tox/docs
basepython = python3
deps =
-r{toxinidir}/requirements-dev.txt
.
commands =
sphinx-build -W -T --keep-going -b html {posargs} docs/ docs/_build/html

Expand Down

0 comments on commit dfdfa66

Please sign in to comment.