Skip to content

Commit 65f3d10

Browse files
author
notactuallyfinn
committed
tweeked documentation a bit
1 parent 1fcbb4b commit 65f3d10

3 files changed

Lines changed: 160 additions & 153 deletions

File tree

docs/source/_static/custom.css

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
/*
88
* SPDX-FileContributor: Oliver Bertuch
9+
* SPDX-FileContributor: Michael Fritzsche
910
*/
1011

1112
img.member {
@@ -22,4 +23,31 @@ img.badge-icon {
2223
img.member {
2324
max-width: 23%;
2425
}
26+
}
27+
28+
img {
29+
display: block;
30+
margin: auto;
31+
}
32+
33+
.bd-page-width {
34+
max-width: none !important;
35+
}
36+
37+
@media (min-width: 1200px) {
38+
.bd-article-container {
39+
max-width: none !important;
40+
}
41+
}
42+
43+
.bd-article-container {
44+
max-width: 100%;
45+
}
46+
47+
.bd-sidebar-primary.bd-sidebar {
48+
max-width: 340px;
49+
}
50+
51+
.bd-sidebar-secondary{
52+
max-width: min-content;
2553
}

docs/source/conf.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def read_from_pyproject(file_path="../../pyproject.toml"):
3939
data = toml.load(file_path)
4040

4141
# Navigate to the authors metadata
42-
metadata = data.get("tool", {}).get("poetry", {})
42+
metadata = data.get("project", {})
4343
if not metadata:
4444
return "No metadata found in pyproject.toml"
4545
return metadata
@@ -56,7 +56,7 @@ def read_authors_from_pyproject():
5656
if not authors:
5757
return "No authors metadata found in pyproject.toml"
5858
# Convert the list of authors to a comma-separated string
59-
return ", ".join([a.split(" <")[0] for a in authors])
59+
return ", ".join([author["name"] for author in authors])
6060

6161
def read_version_from_pyproject():
6262
metadata = read_from_pyproject()
@@ -73,7 +73,7 @@ def read_version_from_pyproject():
7373
author = read_authors_from_pyproject()
7474

7575
# The full version, including alpha/beta/rc tags
76-
release = read_version_from_pyproject()
76+
version = release = read_version_from_pyproject()
7777

7878

7979
# -- General configuration ---------------------------------------------------
@@ -132,7 +132,7 @@ def read_version_from_pyproject():
132132
autoapi_root = "api"
133133
autoapi_ignore = ["*__main__*"]
134134
autoapi_options = [
135-
"members", "undoc-members", "private-members", "show-inheritance", "show-module-summary", "special-members"
135+
"members", "undoc-members", "private-members", "special-members", "show-inheritance", "show-module-summary"
136136
]
137137

138138
# -- Options for HTML output -------------------------------------------------
@@ -164,6 +164,7 @@ def read_version_from_pyproject():
164164
"repository_url": "https://github.com/hermes-hmc/hermes",
165165
"use_repository_button": True,
166166
"navigation_with_keys": False,
167+
"max_navbar_depth": -1
167168
}
168169

169170
html_css_files = [
@@ -185,3 +186,19 @@ def read_version_from_pyproject():
185186
# -- Options for sphinx-togglebutton -----------------------------------------
186187

187188
togglebutton_hint = "Click to show screenshot"
189+
190+
191+
# TODO: remove this workaround and remove "undoc-members" from autoapi_options once everything is documented
192+
# This removes all generated entries for known documented classes (because autoapi will add all attributes
193+
# it finds in the code no matter if they are described in a class doc string or not).
194+
def autoapi_skip_member(app, obj_type, name, obj, skip, options):
195+
if obj_type == "attribute":
196+
if any(documented_type in obj.id for documented_type in [
197+
"ld_container", "ld_dict", "ld_list", "ld_merge_container", "ld_merge_dict", "ld_merge_list", "ld_context"
198+
]):
199+
return True
200+
201+
return skip
202+
203+
def setup(app):
204+
app.connect("autoapi-skip-member", autoapi_skip_member)

0 commit comments

Comments
 (0)