From 0fae9e0d3eb2014e33bf021e1f606b4afb80abe1 Mon Sep 17 00:00:00 2001 From: tandemdude <43570299+tandemdude@users.noreply.github.com> Date: Sun, 16 Jun 2024 23:22:25 +0100 Subject: [PATCH] Add docs 404 page --- docs/source/conf.py | 5 +++-- lightbulb/commands/execution.py | 2 +- pyproject.toml | 3 ++- scripts/docs/api_reference_generator.py | 2 ++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 8f6ad99d..af2f3f41 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -45,7 +45,8 @@ "sphinx_copybutton", "sphinx_inline_tabs", "sphinx_design", - "sphinx_prompt" + "sphinx_prompt", + "notfound.extension", ] myst_enable_extensions = ["colon_fence"] @@ -61,7 +62,7 @@ intersphinx_mapping = { "python": ("https://docs.python.org/3", None), - "hikari": ("https://hikari-py.github.io/hikari", None), + "hikari": ("https://docs.hikari-py.dev/en/latest", None), } diff --git a/lightbulb/commands/execution.py b/lightbulb/commands/execution.py index dc111201..525bad75 100644 --- a/lightbulb/commands/execution.py +++ b/lightbulb/commands/execution.py @@ -125,7 +125,7 @@ async def some_hook(pl: lightbulb.ExecutionPipeline, ctx: lightbulb.Context) -> .. code-block:: python - @lightbulb.hook(lightbulb.ExecutionSteps.CHECKS, skip_when_failed=True) + @lightbulb.hook(lightbulb.ExecutionSteps.CHECKS) async def some_hook(pl: lightbulb.ExecutionPipeline, ctx: lightbulb.Context) -> None: # Prevent the hook from running if previous hooks (or the command invocation) failed. # Also see 'ExecutionPipeline.any_hook_failed' and 'ExecutionPipeline.invocation_failed' for diff --git a/pyproject.toml b/pyproject.toml index dbfcc240..c09e3c22 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,8 @@ dev = ["nox==2024.4.15"] "sphinx-copybutton>=0.5.2, <1", "sphinx-inline-tabs==2023.4.21", "sphinx_design>=0.6.0, <1", - "sphinx-prompt>=1.8.0, <2" + "sphinx-prompt>=1.8.0, <2", + "sphinx-notfound-page>=1.0.2, <2", ] "dev.format" = ["ruff>=0.4.8, <1"] "dev.typecheck" = ["pyright>=1.1.367, <2"] diff --git a/scripts/docs/api_reference_generator.py b/scripts/docs/api_reference_generator.py index 8e721785..a9086aa1 100644 --- a/scripts/docs/api_reference_generator.py +++ b/scripts/docs/api_reference_generator.py @@ -129,6 +129,8 @@ def write(self) -> bool: package_name, "=" * len(package_name), "", + ".. automodule:: " + ".".join(parts), + "", ] if package_lines: