Skip to content

Commit 249bff7

Browse files
committed
docs: update build for new readthedocs addons (#1207)
1 parent dc3572e commit 249bff7

File tree

3 files changed

+13
-25
lines changed

3 files changed

+13
-25
lines changed

docs/_static/style.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Historically however, thanks to:
103103
--rtd-ad-background: var(--grey-2);
104104
--rtd-ad-main-text: var(--grey-6);
105105
--rtd-ad-small-text: var(--grey-4);
106-
--rtd-version-background: #272525;
106+
--rtd-version-background: #272725;
107107
--rtd-version-main-text: #fcfcfc;
108108
--attribute-table-title: var(--grey-6);
109109
--attribute-table-list-border: var(--grey-3);
@@ -826,7 +826,7 @@ section h3 {
826826
}
827827

828828
#to-top.is-rtd {
829-
bottom: 90px;
829+
bottom: 100px;
830830
}
831831

832832
#to-top > span {

docs/_templates/layout.html

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -156,16 +156,6 @@
156156
</footer>
157157
{%- endblock %}
158158
</div>
159-
{%- if READTHEDOCS %}
160-
<script>
161-
if (typeof READTHEDOCS_DATA !== "undefined") {
162-
if (!READTHEDOCS_DATA.features) {
163-
READTHEDOCS_DATA.features = {};
164-
}
165-
READTHEDOCS_DATA.features.docsearch_disabled = true;
166-
}
167-
</script>
168-
{%- endif %}
169159

170160
<div id="to-top" onclick="scrollToTop()"{%- if READTHEDOCS %} class="is-rtd"{%- endif %} hidden>
171161
<span><span class="material-icons">arrow_upward</span> to top</span>

docs/conf.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,15 @@ def linkcode_resolve(domain: str, info: Dict[str, Any]) -> Optional[str]:
224224
return f"{github_repo}/blob/{git_ref}/disnake/{path}"
225225

226226

227+
# Links used for cross-referencing stuff in other documentation
228+
# when this is updated hoverxref_intersphinx also needs to be updated IF THE docs are hosted on readthedocs.
229+
intersphinx_mapping = {
230+
"py": ("https://docs.python.org/3", None),
231+
"aio": ("https://docs.aiohttp.org/en/stable/", None),
232+
"req": ("https://requests.readthedocs.io/en/latest/", None),
233+
}
234+
235+
227236
hoverx_default_type = "tooltip"
228237
hoverxref_domains = ["py"]
229238
hoverxref_role_types = dict.fromkeys(
@@ -234,19 +243,7 @@ def linkcode_resolve(domain: str, info: Dict[str, Any]) -> Optional[str]:
234243
hoverxref_tooltip_lazy = True
235244

236245
# these have to match the keys on intersphinx_mapping, and those projects must be hosted on readthedocs.
237-
hoverxref_intersphinx = [
238-
"py",
239-
"aio",
240-
"req",
241-
]
242-
243-
# Links used for cross-referencing stuff in other documentation
244-
# when this is updated hoverxref_intersphinx also needs to be updated IF THE docs are hosted on readthedocs.
245-
intersphinx_mapping = {
246-
"py": ("https://docs.python.org/3", None),
247-
"aio": ("https://docs.aiohttp.org/en/stable/", None),
248-
"req": ("https://requests.readthedocs.io/en/latest/", None),
249-
}
246+
hoverxref_intersphinx = list(intersphinx_mapping.keys())
250247

251248

252249
# use proxied API endpoint on readthedocs to avoid CORS issues
@@ -290,6 +287,7 @@ def linkcode_resolve(domain: str, info: Dict[str, Any]) -> Optional[str]:
290287
("disnake.ext.commands", "ext/commands"),
291288
("disnake.ext.tasks", "ext/tasks"),
292289
],
290+
"READTHEDOCS": _IS_READTHEDOCS,
293291
}
294292

295293
resource_links = {

0 commit comments

Comments
 (0)