Skip to content

Commit

Permalink
docs: update build for new readthedocs addons (#1207)
Browse files Browse the repository at this point in the history
  • Loading branch information
shiftinv authored Sep 5, 2024
1 parent c7123d6 commit 4a5475c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 25 deletions.
4 changes: 2 additions & 2 deletions docs/_static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Historically however, thanks to:
--rtd-ad-background: var(--grey-2);
--rtd-ad-main-text: var(--grey-6);
--rtd-ad-small-text: var(--grey-4);
--rtd-version-background: #272525;
--rtd-version-background: #272725;
--rtd-version-main-text: #fcfcfc;
--attribute-table-title: var(--grey-6);
--attribute-table-list-border: var(--grey-3);
Expand Down Expand Up @@ -826,7 +826,7 @@ section h3 {
}

#to-top.is-rtd {
bottom: 90px;
bottom: 100px;
}

#to-top > span {
Expand Down
10 changes: 0 additions & 10 deletions docs/_templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,6 @@
</footer>
{%- endblock %}
</div>
{%- if READTHEDOCS %}
<script>
if (typeof READTHEDOCS_DATA !== "undefined") {
if (!READTHEDOCS_DATA.features) {
READTHEDOCS_DATA.features = {};
}
READTHEDOCS_DATA.features.docsearch_disabled = true;
}
</script>
{%- endif %}

<div id="to-top" onclick="scrollToTop()"{%- if READTHEDOCS %} class="is-rtd"{%- endif %} hidden>
<span><span class="material-icons">arrow_upward</span> to top</span>
Expand Down
24 changes: 11 additions & 13 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,15 @@ def linkcode_resolve(domain: str, info: Dict[str, Any]) -> Optional[str]:
return f"{github_repo}/blob/{git_ref}/disnake/{path}"


# Links used for cross-referencing stuff in other documentation
# when this is updated hoverxref_intersphinx also needs to be updated IF THE docs are hosted on readthedocs.
intersphinx_mapping = {
"py": ("https://docs.python.org/3", None),
"aio": ("https://docs.aiohttp.org/en/stable/", None),
"req": ("https://requests.readthedocs.io/en/latest/", None),
}


hoverx_default_type = "tooltip"
hoverxref_domains = ["py"]
hoverxref_role_types = dict.fromkeys(
Expand All @@ -235,19 +244,7 @@ def linkcode_resolve(domain: str, info: Dict[str, Any]) -> Optional[str]:
hoverxref_tooltip_lazy = True

# these have to match the keys on intersphinx_mapping, and those projects must be hosted on readthedocs.
hoverxref_intersphinx = [
"py",
"aio",
"req",
]

# Links used for cross-referencing stuff in other documentation
# when this is updated hoverxref_intersphinx also needs to be updated IF THE docs are hosted on readthedocs.
intersphinx_mapping = {
"py": ("https://docs.python.org/3", None),
"aio": ("https://docs.aiohttp.org/en/stable/", None),
"req": ("https://requests.readthedocs.io/en/latest/", None),
}
hoverxref_intersphinx = list(intersphinx_mapping.keys())


# use proxied API endpoint on readthedocs to avoid CORS issues
Expand Down Expand Up @@ -291,6 +288,7 @@ def linkcode_resolve(domain: str, info: Dict[str, Any]) -> Optional[str]:
("disnake.ext.commands", "ext/commands"),
("disnake.ext.tasks", "ext/tasks"),
],
"READTHEDOCS": _IS_READTHEDOCS,
}

resource_links = {
Expand Down

0 comments on commit 4a5475c

Please sign in to comment.