mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
Ignore d.py's |coro| substitution in Sphinx (#5648)
This commit is contained in:
parent
d8e20afa1d
commit
67e43eb00b
18
docs/conf.py
18
docs/conf.py
@ -251,3 +251,21 @@ doctest_test_doctest_blocks = ""
|
|||||||
# Autodoc options
|
# Autodoc options
|
||||||
autodoc_default_options = {"show-inheritance": True}
|
autodoc_default_options = {"show-inheritance": True}
|
||||||
autodoc_typehints = "none"
|
autodoc_typehints = "none"
|
||||||
|
|
||||||
|
|
||||||
|
from docutils import nodes
|
||||||
|
from sphinx.transforms import SphinxTransform
|
||||||
|
|
||||||
|
|
||||||
|
# d.py's |coro| substitution leaks into our docs because we don't replace some of the docstrings
|
||||||
|
class IgnoreCoroSubstitution(SphinxTransform):
|
||||||
|
default_priority = 210
|
||||||
|
|
||||||
|
def apply(self, **kwargs) -> None:
|
||||||
|
for ref in self.document.traverse(nodes.substitution_reference):
|
||||||
|
if ref["refname"] == "coro":
|
||||||
|
ref.replace_self(nodes.Text("", ""))
|
||||||
|
|
||||||
|
|
||||||
|
def setup(app):
|
||||||
|
app.add_transform(IgnoreCoroSubstitution)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user