Skip to content

Commit a7e48e3

Browse files
committed
Remove requirements in main and enable darkmode for pngs
1 parent 86e5319 commit a7e48e3

File tree

5 files changed

+25
-11
lines changed

5 files changed

+25
-11
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ jobs:
2020
uses: sphinx-notes/pages@v3
2121
with:
2222
documentation_path: ./docs/source
23+
cache: true

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
furo
22
myst-parser
3+
pydata-sphinx-theme
34
sphinx-autoapi
45
sphinx-autodoc-typehints
56
sphinx-copybutton
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
html[data-theme="dark"] img {
2+
filter: none;
3+
}
4+
html[data-theme="dark"] .bd-content img:not(.only-dark):not(.dark-light) {
5+
background: unset;
6+
}

docs/source/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@
6060
# html_logo = "_static/logo.png" # Optional: Add a logo file to _static/
6161
# html_favicon = "_static/favicon.ico" # Optional: Add a favicon
6262
html_static_path = ["_static"]
63+
html_css_files = [
64+
"css/darkmode-image.css",
65+
]
6366

6467
# Napoleon config
6568
# napoleon_google_docstring = True

pyfracval/__init__.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,19 @@
66
__version__ = ""
77
_authors = ""
88

9-
project_root = Path(__file__).parent.parent
10-
with open(project_root / "pyproject.toml", "rb") as f:
11-
data = tomllib.load(f)
9+
package_src = Path(__file__).parent
10+
# _version = package_src / "VERSION"
11+
_pyproject = package_src.parent / "pyproject.toml"
12+
if _pyproject.is_file():
13+
with open(_pyproject, "rb") as f:
14+
data = tomllib.load(f)
1215

13-
if "version" in data["project"]:
14-
__version__ = data["project"]["version"]
15-
else:
16-
raise ValueError("Version not found in pyproject.toml")
16+
if "version" in data["project"]:
17+
__version__ = data["project"]["version"]
18+
else:
19+
raise ValueError("Version not found in pyproject.toml")
1720

18-
if "authors" in data["project"]:
19-
_authors = ",".join([x["name"] for x in data["project"]["authors"]])
20-
else:
21-
raise ValueError("Version not found in pyproject.toml")
21+
if "authors" in data["project"]:
22+
_authors = ",".join([x["name"] for x in data["project"]["authors"]])
23+
else:
24+
raise ValueError("Version not found in pyproject.toml")

0 commit comments

Comments
 (0)