mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 18:27:59 -05:00
[Docs] Change links to d.py docs to use pinned version instead of v1.0.1. (#3053)
* docs: change links to d.py docs to use stable version instead of v1.0.1 * chore(changelog): add towncrier entry * docs: add |DPY_VERSION| substitution and :dpy_docs: role * chore(changelog): update towncrier entries to reflect new changes
This commit is contained in:
12
docs/conf.py
12
docs/conf.py
@@ -36,6 +36,7 @@ os.environ["BUILDING_DOCS"] = "1"
|
||||
# ones.
|
||||
extensions = [
|
||||
"sphinx.ext.autodoc",
|
||||
"sphinx.ext.extlinks",
|
||||
"sphinx.ext.intersphinx",
|
||||
"sphinx.ext.viewcode",
|
||||
"sphinx.ext.napoleon",
|
||||
@@ -65,6 +66,7 @@ author = "Cog Creators"
|
||||
# built documents.
|
||||
#
|
||||
from redbot.core import __version__
|
||||
from discord import __version__ as dpy_version
|
||||
|
||||
# The short X.Y version.
|
||||
version = __version__
|
||||
@@ -96,6 +98,9 @@ default_role = "any"
|
||||
with open("prolog.txt", "r") as file:
|
||||
rst_prolog = file.read()
|
||||
|
||||
# Adds d.py version to available substitutions in all files
|
||||
rst_prolog = f"\n.. |DPY_VERSION| replace:: {dpy_version}"
|
||||
|
||||
# -- Options for HTML output ----------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
@@ -209,10 +214,15 @@ linkcheck_ignore = [r"https://java.com*", r"https://chocolatey.org*"]
|
||||
# Intersphinx
|
||||
intersphinx_mapping = {
|
||||
"python": ("https://docs.python.org/3", None),
|
||||
"dpy": ("https://discordpy.readthedocs.io/en/v1.0.1/", None),
|
||||
"dpy": (f"https://discordpy.readthedocs.io/en/v{dpy_version}/", None),
|
||||
"motor": ("https://motor.readthedocs.io/en/stable/", None),
|
||||
}
|
||||
|
||||
# Extlinks
|
||||
# This allows to create links to d.py docs with
|
||||
# :dpy_docs:`link text <site_name.html>`
|
||||
extlinks = {"dpy_docs": (f"https://discordpy.readthedocs.io/en/v{dpy_version}/%s", None)}
|
||||
|
||||
# Doctest
|
||||
# If this string is non-empty, all blocks with ``>>>`` in them will be
|
||||
# tested, not just the ones explicitly marked with ``.. doctest::``
|
||||
|
||||
Reference in New Issue
Block a user