1
|
|
|
# -*- coding: utf-8 -*- |
2
|
|
|
|
3
|
|
|
import os |
4
|
|
|
import sys |
5
|
|
|
import oemof.solph |
6
|
|
|
|
7
|
|
|
import matplotlib |
8
|
|
|
from sphinx.ext.autodoc import between |
9
|
|
|
|
10
|
|
|
|
11
|
|
|
matplotlib.use("agg") |
12
|
|
|
sys.path.append(os.path.join(os.path.dirname(__file__), "..", "examples")) |
13
|
|
|
|
14
|
|
|
|
15
|
|
|
def setup(app): |
16
|
|
|
# Register a sphinx.ext.autodoc.between listener to ignore everything |
17
|
|
|
# between lines that contain the word IGNORE |
18
|
|
|
app.connect("autodoc-process-docstring", between("^SPDX.*$", exclude=True)) |
19
|
|
|
return app |
20
|
|
|
|
21
|
|
|
|
22
|
|
|
# -- General configuration ------------------------------------------------ |
23
|
|
|
|
24
|
|
|
# Add any Sphinx extension module names here, as strings. They can be |
25
|
|
|
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
26
|
|
|
# ones. |
27
|
|
|
extensions = [ |
28
|
|
|
"sphinx.ext.autodoc", |
29
|
|
|
"sphinx.ext.autosummary", |
30
|
|
|
"sphinx.ext.coverage", |
31
|
|
|
"sphinx.ext.doctest", |
32
|
|
|
"sphinx.ext.extlinks", |
33
|
|
|
"sphinx.ext.ifconfig", |
34
|
|
|
"sphinx.ext.napoleon", |
35
|
|
|
"sphinx.ext.todo", |
36
|
|
|
"sphinx.ext.viewcode", |
37
|
|
|
"sphinx_copybutton", |
38
|
|
|
"sphinx_design", |
39
|
|
|
] |
40
|
|
|
|
41
|
|
|
# landing page |
42
|
|
|
# master_doc = 'contents' |
43
|
|
|
# names, years, etc |
44
|
|
|
project = "oemof.solph" |
45
|
|
|
year = "2025" |
46
|
|
|
author = "oemof developer group" |
47
|
|
|
copyright = "{0}, {1}".format(year, author) |
48
|
|
|
|
49
|
|
|
# The short X.Y version. |
50
|
|
|
version = oemof.solph.__version__.split(" ")[0] |
51
|
|
|
# The full version, including alpha/beta/rc tags. |
52
|
|
|
release = oemof.solph.__version__ |
53
|
|
|
|
54
|
|
|
# The suffix of source filenames. |
55
|
|
|
source_suffix = {".rst": "restructuredtext"} |
56
|
|
|
# folder for templates |
57
|
|
|
templates_path = ["_templates"] |
58
|
|
|
|
59
|
|
|
# List of patterns, relative to source directory, that match files and |
60
|
|
|
# directories to ignore when looking for source files. |
61
|
|
|
exclude_patterns = ["_build"] |
62
|
|
|
|
63
|
|
|
# The name of the Pygments (syntax highlighting) style to use. |
64
|
|
|
# pygments_style = "some" |
65
|
|
|
# pygments_dark_style = "someother" |
66
|
|
|
|
67
|
|
|
# show all class members |
68
|
|
|
# numpydoc_show_class_members = False |
69
|
|
|
|
70
|
|
|
# place for bibtex references |
71
|
|
|
bibtex_bibfiles = ["references.bib"] |
72
|
|
|
|
73
|
|
|
# links to github |
74
|
|
|
github_repo_url = "https://github.com/oemof/oemof-solph/" |
75
|
|
|
extlinks = { |
76
|
|
|
"issue": (f"{github_repo_url}/issues/%s", "#%s"), # noqa: WPS323 |
77
|
|
|
"pr": (f"{github_repo_url}/pull/%s", "PR #%s"), # noqa: WPS323 |
78
|
|
|
"commit": (f"{github_repo_url}/commit/%s", "%s"), # noqa: WPS323 |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
# Automatic numbering of figures, tables, etc. |
82
|
|
|
numfig = True |
83
|
|
|
numfig_secnum_depth = 1 |
84
|
|
|
|
85
|
|
|
# -- Options for HTML output ---------------------------------------------- |
86
|
|
|
|
87
|
|
|
# The theme to use for HTML and HTML Help pages. |
88
|
|
|
html_theme = "furo" |
89
|
|
|
|
90
|
|
|
# The name for this set of Sphinx documents. If None, it defaults to |
91
|
|
|
# "<project> v<release> documentation". |
92
|
|
|
html_title = f"v{version}" |
93
|
|
|
|
94
|
|
|
|
95
|
|
|
# A shorter title for the navigation bar. Default is the same as html_title. |
96
|
|
|
html_short_title = "%s-%s" % (project, version) |
97
|
|
|
|
98
|
|
|
# Some more stuff |
99
|
|
|
html_use_smartypants = True |
100
|
|
|
html_last_updated_fmt = "%b %d, %Y" |
101
|
|
|
html_split_index = False |
102
|
|
|
|
103
|
|
|
# The name of an image file (within the static path) to use as favicon of the |
104
|
|
|
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 |
105
|
|
|
# pixels large. |
106
|
|
|
# html_favicon = None |
107
|
|
|
|
108
|
|
|
# Add any paths that contain custom static files (such as style sheets) here, |
109
|
|
|
# relative to this directory. They are copied after the builtin static files, |
110
|
|
|
# so a file named "default.css" will overwrite the builtin "default.css". |
111
|
|
|
html_static_path = ["_static"] |
112
|
|
|
html_css_files = [ |
113
|
|
|
"css/custom.css", |
114
|
|
|
] |
115
|
|
|
# html_additional_pages = { |
116
|
|
|
# "index": "index.html" |
117
|
|
|
# } |
118
|
|
|
|
119
|
|
|
html_sidebars = { |
120
|
|
|
"**": [ |
121
|
|
|
"sidebar/brand.html", |
122
|
|
|
"sidebar/search.html", |
123
|
|
|
"sidebar/scroll-start.html", |
124
|
|
|
"sidebar/navigation.html", |
125
|
|
|
"sidebar/ethical-ads.html", |
126
|
|
|
"sidebar/scroll-end.html", |
127
|
|
|
"sidebar/variant-selector.html", |
128
|
|
|
], |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
html_theme_options = { |
132
|
|
|
"light_logo": "./_logo/logo_oemof_solph_COMPACT.svg", |
133
|
|
|
"dark_logo": "./_logo/logo_oemof_solph_COMPACT_darkmode.svg", |
134
|
|
|
"announcement": """ |
135
|
|
|
<div oemof-announcement=\"https://raw.githubusercontent.com/oemof/oemof-solph/announcements/announcement.html\"></div> |
136
|
|
|
""", |
137
|
|
|
} |
138
|
|
|
|
139
|
|
|
html_js_files = [ |
140
|
|
|
"js/custom.js", |
141
|
|
|
] |
142
|
|
|
|
143
|
|
|
|
144
|
|
|
html_favicon = "./_static/_logo/logo_oemof_solph_ICON.svg" |
145
|
|
|
|
146
|
|
|
napoleon_use_ivar = True |
147
|
|
|
napoleon_use_rtype = False |
148
|
|
|
napoleon_use_param = False |
149
|
|
|
|
150
|
|
|
# copybutton configuration |
151
|
|
|
copybutton_prompt_text = r">>> |\.\.\. " |
152
|
|
|
copybutton_prompt_is_regexp = True |
153
|
|
|
|
154
|
|
|
# Output file base name for HTML help builder. |
155
|
|
|
htmlhelp_basename = "oemof.solph_doc" |
156
|
|
|
|
157
|
|
|
linkcheck_ignore = [ |
158
|
|
|
r"https://requires.io/.*", |
159
|
|
|
r"https://matrix.to/*", |
160
|
|
|
r"https://forum.openmod-initiative.org/*", |
161
|
|
|
r"https://github.com/oemof/oemof-solph/issues/*", |
162
|
|
|
r"https://github.com/oemof/oemof-solph/pull/*", |
163
|
|
|
# DOIs always redirect, we believe they will always work. |
164
|
|
|
r"https://doi.org/*", |
165
|
|
|
# Due to traffic limitation, the folowwing create a 403 in CI pipeline: |
166
|
|
|
"https://sourceforge.net/projects/winglpk/", |
167
|
|
|
] |
168
|
|
|
|