Skip to content

Commit f5f7c5a

Browse files
authored
Add flag to skip generation of reference docs when running sphinx (#1532)
1 parent 7b04d7d commit f5f7c5a

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ py -3 -m pip install -U hikari
3535
## Bots
3636

3737
Hikari provides two different default bot implementations to suit your needs:
38-
- [GatewayBot](#GatewayBot)
39-
- [RESTBot](#RESTBot)
38+
- [GatewayBot](#gatewaybot)
39+
- [RESTBot](#restbot)
4040

4141
### GatewayBot
4242

docs/conf.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,22 @@
5757
"sphinx.ext.intersphinx",
5858
"sphinx.ext.viewcode",
5959
"sphinx.ext.mathjax",
60-
# Docs generation
61-
"autoapi.extension",
62-
"numpydoc",
60+
# Our extensions
6361
"myst_parser",
64-
# Misc
6562
"sphinxext.opengraph",
6663
"sphinx_copybutton",
6764
"sphinxcontrib.towncrier.ext",
6865
]
6966

67+
if os.getenv("SKIP_REFERENCE_DOCS") is None:
68+
extensions.extend(
69+
(
70+
"autoapi.extension",
71+
"numpydoc",
72+
)
73+
)
74+
75+
7076
templates_path = ["_templates"]
7177
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
7278

hikari/api/rest.py

+1
Original file line numberDiff line numberDiff line change
@@ -2738,6 +2738,7 @@ async def set_my_user_application_role_connection(
27382738
Depending on the time of the previously created application role
27392739
records through `set_application_role_connection_metadata_records`,
27402740
this mapping should contain those keys to the valid type of the record:
2741+
27412742
- `INTEGER_X`: An `int`.
27422743
- `DATETIME_X`: A `datetime.datetime` object.
27432744
- `BOOLEAN_X`: A `bool`.

pipelines/sphinx.nox.py

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
@nox.session(reuse_venv=True)
3737
def sphinx(session: nox.Session):
3838
"""Generate docs using sphinx."""
39+
if "--no-refs" in session.posargs:
40+
session.env["SKIP_REFERENCE_DOCS"] = "1"
41+
3942
if not os.path.exists(config.ARTIFACT_DIRECTORY):
4043
os.mkdir(config.ARTIFACT_DIRECTORY)
4144

0 commit comments

Comments
 (0)