Skip to content

Commit

Permalink
Upgrade to qiskit_sphinx_theme 1.12 (backport #518) (#519)
Browse files Browse the repository at this point in the history
* Upgrade to qiskit_sphinx_theme 1.12 (#518)

(cherry picked from commit 0f6e3b9)

* #475 was not backported so I did what was done there here

* Missed getting rid of the line I should have removed!

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com>
  • Loading branch information
3 people authored May 26, 2023
1 parent 1d8007b commit 819a4c7
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 187 deletions.
Binary file removed docs/_static/no_image.png
Binary file not shown.
50 changes: 11 additions & 39 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,7 @@
sys.path.insert(0, os.path.abspath(".."))
sys.path.append(os.path.abspath("."))

"""
Sphinx documentation builder
"""

import qiskit_sphinx_theme
import qiskit_optimization
from custom_directives import CustomCalloutItemDirective

# Set env flag so that we can doc functions that may otherwise not be loaded
# see for example interactive visualizations in qiskit.visualization.
Expand All @@ -47,6 +41,8 @@
copyright = f"2018, {date.today().year}, Qiskit Optimization Development Team" # pylint: disable=redefined-builtin
author = "Qiskit Optimization Development Team"

docs_url_prefix = "ecosystem/optimization"

# The short X.Y version
version = qiskit_optimization.__version__
# The full version, including alpha/beta/rc tags
Expand Down Expand Up @@ -80,13 +76,6 @@

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

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.napoleon",
"sphinx.ext.autodoc",
Expand Down Expand Up @@ -114,7 +103,7 @@
"tutorials/03_minimum_eigen_optimizer": "_static/3_min_eig_opt.png",
"tutorials/04_grover_optimizer": "_static/4_grover.png",
"tutorials/05_admm_optimizer": "_static/5_ADMM.png",
"**": "_static/no_image.png",
"**": "_static/images/logo.png",
}

spelling_word_list_filename = "../.pylintdict"
Expand Down Expand Up @@ -151,15 +140,15 @@
# strings that are used for format of figure numbers. As a special character,
# %s will be replaced to figure number.
numfig_format = {"table": "Table %s"}
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = "en"

# For Adding Locale
locale_dirs = ["locale/"] # path is example but recommended.
translations_list = [
("en", "English"),
("bn_BN", "Bengali"),
("ja_JP", "Japanese"),
("es_UN", "Spanish"),
]
language = "en"
locale_dirs = ["locale/"]
gettext_compact = False # optional.

# List of patterns, relative to source directory, that match files and
Expand Down Expand Up @@ -187,18 +176,7 @@

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

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
#
html_theme = "qiskit_sphinx_theme"

html_theme_path = [".", qiskit_sphinx_theme.get_html_theme_path()]

# 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_only": False,
"display_version": True,
Expand All @@ -222,9 +200,3 @@
}

html_context = {"analytics_enabled": True}
# -- Extension configuration -------------------------------------------------


def setup(app):
app.add_directive("customcalloutitem", CustomCalloutItemDirective)
app.setup_extension("versionutils")
66 changes: 0 additions & 66 deletions docs/custom_directives.py

This file was deleted.

4 changes: 2 additions & 2 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ See :ref:`optional_installs` for more information.

.. tab-item:: Start locally

The simplest way to get started is to follow the `getting started 'Start locally' guide for
The simplest way to get started is to follow the `getting started 'Start locally' guide for
Qiskit <https://qiskit.org/documentation/getting_started.html>`__

In your virtual environment where you installed Qiskit simply add ``optimization`` to the
Expand Down Expand Up @@ -118,7 +118,7 @@ Ready to get going?...
<div class="tutorials-callout-container">
<div class="row">

.. customcalloutitem::
.. qiskit-call-to-action-item::
:description: Find out about Qiskit Optimization.
:header: Dive into the tutorials
:button_link: ./tutorials/index.html
Expand Down
78 changes: 0 additions & 78 deletions docs/versionutils.py

This file was deleted.

4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.black]
line-length = 100
target-version = ['py37', 'py38', 'py39', 'py310']
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ qiskit-aer>=0.11
mypy>=0.981
mypy-extensions>=0.4.3
nbsphinx
qiskit_sphinx_theme~=1.11.1
qiskit_sphinx_theme~=1.12.0
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ deps =
-r{toxinidir}/requirements-dev.txt
.
commands =
sphinx-build -W -T --keep-going -b html {posargs} docs/ docs/_build/html
sphinx-build -j auto -W -T --keep-going -b html {posargs} docs/ docs/_build/html

[testenv:gettext]
envdir = .tox/docs
Expand Down

0 comments on commit 819a4c7

Please sign in to comment.