Skip to content

Commit 9b89b92

Browse files
committed
📝 docs: read the docs
Signed-off-by: Zerohertz <ohg3417@gmail.com>
1 parent bc7100f commit 9b89b92

4 files changed

Lines changed: 37 additions & 7 deletions

File tree

.readthedocs.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Read the Docs configuration file
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
# Required
5+
version: 2
6+
7+
# Set the OS, Python version, and other tools you might need
8+
build:
9+
os: ubuntu-24.04
10+
tools:
11+
python: "3.10"
12+
jobs:
13+
pre_build:
14+
- python -m pip install --upgrade pip
15+
- pip install .'[all]'
16+
17+
# Build documentation in the "docs/" directory with Sphinx
18+
sphinx:
19+
configuration: sphinx/source/conf.py
20+
21+
# Optionally, but recommended,
22+
# declare the Python requirements required to build your documentation
23+
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
24+
python:
25+
install:
26+
- requirements: requirements/requirements-docs.txt

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<a href="https://github.com/Zerohertz/zerohertzLib">
1616
<img src="https://img.shields.io/badge/GitHub-181717?style=for-the-badge&logo=GitHub&logoColor=white"/>
1717
</a>
18-
<a href="https://zerohertz.github.io/zerohertzLib/">
18+
<a href="https://zerohertzlib.readthedocs.io/">
1919
<img src="https://img.shields.io/badge/Sphinx-Docs-000000?style=for-the-badge&logo=Sphinx&logoColor=white"/>
2020
</a>
2121
</br>

sphinx/source/conf.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
autodoc_typehints = "none"
6161
todo_include_todos = True
6262
gtagjs_ids = [
63-
"G-ZCW0CR8M8X",
63+
"G-J25S5BY1L7",
6464
]
6565
# add_module_names = False
6666

@@ -88,7 +88,9 @@
8888
# relative to this directory. They are copied after the builtin static files,
8989
# so a file named "default.css" will overwrite the builtin "default.css".
9090
html_theme = "furo"
91-
html_baseurl = "https://zerohertz.github.io/zerohertzLib/"
91+
html_baseurl = os.getenv(
92+
"READTHEDOCS_CANONICAL_URL", "https://zerohertzlib.readthedocs.io/"
93+
)
9294
html_static_path = ["_static"]
9395
html_logo = "_static/zerohertzLib-tp-red.png"
9496

@@ -131,7 +133,9 @@
131133
],
132134
}
133135

134-
ogp_site_url = "https://zerohertz.github.io/zerohertzLib/"
136+
ogp_site_url = os.getenv(
137+
"READTHEDOCS_CANONICAL_URL", "https://zerohertzlib.readthedocs.io/"
138+
)
135139
ogp_description_length = 200
136140
ogp_site_name = f"Zerohertz's Library {release} Documents"
137141
ogp_image = "_static/zerohertzLib-black-red-og.png"
@@ -157,7 +161,7 @@ def linkcode_resolve(domain, info):
157161
obj = getattr(obj, part)
158162
obj_filename = inspect.getsourcefile(obj)
159163
obj_line = inspect.getsourcelines(obj)[1]
160-
except Exception as error:
164+
except Exception:
161165
return None
162166
rel_fn = relpath(obj_filename, start=dirname(module.__file__))
163167
return f"https://github.com/zerohertz/zerohertzLib/blob/master/{info['module'].replace('.', '/')}/{rel_fn}#L{obj_line}"
@@ -168,7 +172,7 @@ def linkcode_resolve(domain, info):
168172
# html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
169173
# https://sphinx-rtd-theme.readthedocs.io/en/stable/configuring.html
170174
# html_theme_options = {
171-
# "analytics_id": "G-ZCW0CR8M8X",
175+
# "analytics_id": "G-J25S5BY1L7",
172176
# "analytics_anonymize_ip": False,
173177
# "logo_only": True,
174178
# "style_nav_header_background": "#000000",

sphinx/source/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<a href="https://github.com/Zerohertz/zerohertzLib">
2121
<img src="https://img.shields.io/badge/GitHub-181717?style=for-the-badge&logo=GitHub&logoColor=white"/>
2222
</a>
23-
<a href="https://zerohertz.github.io/zerohertzLib/">
23+
<a href="https://zerohertzlib.readthedocs.io/">
2424
<img src="https://img.shields.io/badge/Sphinx-Docs-000000?style=for-the-badge&logo=Sphinx&logoColor=white"/>
2525
</a>
2626
</br>

0 commit comments

Comments
 (0)