Skip to content

Commit

Permalink
Add flag to skip generation of reference docs when running sphinx (#1532
Browse files Browse the repository at this point in the history
)
  • Loading branch information
davfsa authored Mar 5, 2023
1 parent 7b04d7d commit f5f7c5a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ py -3 -m pip install -U hikari
## Bots

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

### GatewayBot

Expand Down
14 changes: 10 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,22 @@
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
"sphinx.ext.mathjax",
# Docs generation
"autoapi.extension",
"numpydoc",
# Our extensions
"myst_parser",
# Misc
"sphinxext.opengraph",
"sphinx_copybutton",
"sphinxcontrib.towncrier.ext",
]

if os.getenv("SKIP_REFERENCE_DOCS") is None:
extensions.extend(
(
"autoapi.extension",
"numpydoc",
)
)


templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

Expand Down
1 change: 1 addition & 0 deletions hikari/api/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2738,6 +2738,7 @@ async def set_my_user_application_role_connection(
Depending on the time of the previously created application role
records through `set_application_role_connection_metadata_records`,
this mapping should contain those keys to the valid type of the record:
- `INTEGER_X`: An `int`.
- `DATETIME_X`: A `datetime.datetime` object.
- `BOOLEAN_X`: A `bool`.
Expand Down
3 changes: 3 additions & 0 deletions pipelines/sphinx.nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
@nox.session(reuse_venv=True)
def sphinx(session: nox.Session):
"""Generate docs using sphinx."""
if "--no-refs" in session.posargs:
session.env["SKIP_REFERENCE_DOCS"] = "1"

if not os.path.exists(config.ARTIFACT_DIRECTORY):
os.mkdir(config.ARTIFACT_DIRECTORY)

Expand Down

0 comments on commit f5f7c5a

Please sign in to comment.