mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-12 09:37:25 +00:00
Updated for various Sphinx API changes. Also drop rendered math. Simpler and makes the plain Python docstrings look better in jedi. ``` :math:`0 \leq x \leq 255`. ``` just becomes 0 ≤ x ≤ 255. Also drop Latex dependencies. We don't rely on the PDF and don't need it for math anymore.
32 lines
814 B
Python
32 lines
814 B
Python
"""This directive hides the builtin directives
|
|
* versionchanged
|
|
* versionadded
|
|
* deprecated
|
|
when building documentation with the 'ide' tag.
|
|
"""
|
|
|
|
from docutils import nodes
|
|
from docutils.parsers.rst import Directive
|
|
|
|
|
|
class PybricksVersionDirective(Directive):
|
|
has_content = True
|
|
|
|
def run(self):
|
|
html = ""
|
|
node = nodes.raw("", html, format="html")
|
|
return [node]
|
|
|
|
|
|
def setup(app):
|
|
if app.tags.has("ide"):
|
|
app.add_directive_to_domain(
|
|
"py", "deprecated", PybricksVersionDirective, override=True
|
|
)
|
|
app.add_directive_to_domain(
|
|
"py", "versionadded", PybricksVersionDirective, override=True
|
|
)
|
|
app.add_directive_to_domain(
|
|
"py", "versionchanged", PybricksVersionDirective, override=True
|
|
)
|