|
14 | 14 |
|
15 | 15 | """Sphinx documentation builder.""" |
16 | 16 |
|
17 | | -# -- General configuration --------------------------------------------------- |
18 | 17 | import datetime |
19 | 18 | import doctest |
| 19 | +import os |
20 | 20 |
|
21 | 21 | project = "Qiskit" |
22 | | -copyright = f"2017-{datetime.date.today().year}, Qiskit Development Team" # pylint: disable=redefined-builtin |
| 22 | +project_copyright = f"2017-{datetime.date.today().year}, Qiskit Development Team" |
23 | 23 | author = "Qiskit Development Team" |
24 | 24 |
|
25 | 25 | # The short X.Y version |
|
39 | 39 | "reno.sphinxext", |
40 | 40 | "sphinx_design", |
41 | 41 | "matplotlib.sphinxext.plot_directive", |
42 | | - "sphinx.ext.doctest", |
| 42 | + "qiskit_sphinx_theme", |
| 43 | + "nbsphinx", |
43 | 44 | ] |
44 | 45 |
|
45 | 46 | templates_path = ["_templates"] |
|
77 | 78 | "matplotlib": ("https://matplotlib.org/stable/", None), |
78 | 79 | } |
79 | 80 |
|
80 | | -# -- Options for HTML output ------------------------------------------------- |
| 81 | +# ---------------------------------------------------------------------------------- |
| 82 | +# HTML theme |
| 83 | +# ---------------------------------------------------------------------------------- |
81 | 84 |
|
82 | 85 | html_theme = "qiskit_sphinx_theme" |
83 | 86 | html_last_updated_fmt = "%Y/%m/%d" |
|
88 | 91 | "style_external_links": True, |
89 | 92 | } |
90 | 93 |
|
91 | | - |
92 | | -# -- Options for Autosummary and Autodoc ------------------------------------- |
| 94 | +# ---------------------------------------------------------------------------------- |
| 95 | +# Autodoc |
| 96 | +# ---------------------------------------------------------------------------------- |
93 | 97 |
|
94 | 98 | # Note that setting autodoc defaults here may not have as much of an effect as you may expect; any |
95 | 99 | # documentation created by autosummary uses a template file (in autosummary in the templates path), |
|
131 | 135 | napoleon_numpy_docstring = False |
132 | 136 |
|
133 | 137 |
|
134 | | -# -- Options for Doctest -------------------------------------------------------- |
| 138 | +# ---------------------------------------------------------------------------------- |
| 139 | +# Doctest |
| 140 | +# ---------------------------------------------------------------------------------- |
135 | 141 |
|
136 | 142 | doctest_default_flags = ( |
137 | 143 | doctest.ELLIPSIS |
|
145 | 151 | # >> code |
146 | 152 | # output |
147 | 153 | doctest_test_doctest_blocks = "" |
| 154 | + |
| 155 | +# ---------------------------------------------------------------------------------- |
| 156 | +# Nbsphinx |
| 157 | +# ---------------------------------------------------------------------------------- |
| 158 | + |
| 159 | +nbsphinx_timeout = int(os.getenv("QISKIT_CELL_TIMEOUT", "300")) |
| 160 | +nbsphinx_execute = os.getenv("QISKIT_DOCS_BUILD_TUTORIALS", "never") |
| 161 | +nbsphinx_widgets_path = "" |
| 162 | +nbsphinx_thumbnails = {"**": "_static/images/logo.png"} |
| 163 | + |
| 164 | +nbsphinx_prolog = """ |
| 165 | +{% set docname = env.doc2path(env.docname, base=None) %} |
| 166 | +
|
| 167 | +.. only:: html |
| 168 | +
|
| 169 | + .. role:: raw-html(raw) |
| 170 | + :format: html |
| 171 | +
|
| 172 | + .. note:: |
| 173 | + This page was generated from `{{ docname }}`__. |
| 174 | +
|
| 175 | + __ https://github.com/Qiskit/qiskit-terra/blob/main/{{ docname }} |
| 176 | +
|
| 177 | +""" |
0 commit comments