forked from cda-tum/mqt-qcec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconf.py
147 lines (116 loc) · 4.08 KB
/
conf.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
"""Sphinx configuration file."""
from __future__ import annotations
import warnings
from importlib import metadata
from pathlib import Path
from typing import TYPE_CHECKING
import pybtex.plugin
from pybtex.style.formatting.unsrt import Style as UnsrtStyle
from pybtex.style.template import field, href
if TYPE_CHECKING:
from pybtex.database import Entry
from pybtex.richtext import HRef
ROOT = Path(__file__).parent.parent.resolve()
try:
from mqt.qcec import __version__ as version
except ModuleNotFoundError:
try:
version = metadata.version("mqt.qcec")
except ModuleNotFoundError:
msg = (
"Package should be installed to produce documentation! "
"Assuming a modern git archive was used for version discovery."
)
warnings.warn(msg, stacklevel=1)
from setuptools_scm import get_version
version = get_version(root=str(ROOT), fallback_root=ROOT)
# Filter git details from version
release = version.split("+")[0]
project = "QCEC"
author = "Lukas Burgholzer"
language = "en"
project_copyright = "Chair for Design Automation, Technical University of Munich"
master_doc = "index"
templates_path = ["_templates"]
html_css_files = ["custom.css"]
extensions = [
"sphinx.ext.napoleon",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.mathjax",
"sphinx.ext.intersphinx",
"sphinx.ext.autosectionlabel",
"sphinx.ext.viewcode",
"sphinx.ext.githubpages",
"sphinxcontrib.bibtex",
"sphinx_copybutton",
"hoverxref.extension",
"nbsphinx",
"sphinxext.opengraph",
"sphinx_autodoc_typehints",
]
pygments_style = "colorful"
add_module_names = False
modindex_common_prefix = ["mqt.qcec."]
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"typing_extensions": ("https://typing-extensions.readthedocs.io/en/latest/", None),
"qiskit": ("https://qiskit.org/documentation/", None),
"mqt": ("https://mqt.readthedocs.io/en/latest/", None),
"core": ("https://mqt.readthedocs.io/projects/core/en/latest/", None),
"ddsim": ("https://mqt.readthedocs.io/projects/ddsim/en/latest/", None),
"qmap": ("https://mqt.readthedocs.io/projects/qmap/en/latest/", None),
"qecc": ("https://mqt.readthedocs.io/projects/qecc/en/latest/", None),
"syrec": ("https://mqt.readthedocs.io/projects/syrec/en/latest/", None),
}
nbsphinx_execute = "auto"
highlight_language = "python3"
nbsphinx_execute_arguments = [
"--InlineBackend.figure_formats={'svg', 'pdf'}",
"--InlineBackend.rc=figure.dpi=200",
]
nbsphinx_kernel_name = "python3"
autosectionlabel_prefix_document = True
hoverxref_auto_ref = True
hoverxref_domains = ["cite", "py"]
hoverxref_roles = []
hoverxref_mathjax = True
hoverxref_role_types = {
"ref": "tooltip",
"p": "tooltip",
"labelpar": "tooltip",
"class": "tooltip",
"meth": "tooltip",
"func": "tooltip",
"attr": "tooltip",
"property": "tooltip",
}
exclude_patterns = ["_build", "build", "**.ipynb_checkpoints", "Thumbs.db", ".DS_Store", ".env"]
class CDAStyle(UnsrtStyle):
"""Custom style for including PDF links."""
def format_url(self, _e: Entry) -> HRef: # noqa: PLR6301
"""Format URL field as a link to the PDF."""
url = field("url", raw=True)
return href()[url, "[PDF]"]
pybtex.plugin.register_plugin("pybtex.style.formatting", "cda_style", CDAStyle)
bibtex_bibfiles = ["refs.bib"]
bibtex_default_style = "cda_style"
copybutton_prompt_text = r"(?:\(venv\) )?(?:\[.*\] )?\$ "
copybutton_prompt_is_regexp = True
copybutton_line_continuation_character = "\\"
autosummary_generate = True
typehints_use_rtype = False
napoleon_use_rtype = False
napoleon_google_docstring = True
napoleon_numpy_docstring = False
# -- Options for HTML output -------------------------------------------------
html_theme = "furo"
html_static_path = ["_static"]
html_theme_options = {
"light_logo": "mqt_dark.png",
"dark_logo": "mqt_light.png",
"source_repository": "https://github.com/cda-tum/mqt-qcec/",
"source_branch": "main",
"source_directory": "docs/source",
"navigation_with_keys": True,
}