Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
furo==2024.8.6
sphinx==7.2.6
sphinx-autobuild==2021.3.14
sphinx-autobuild==2024.10.3
sphinx-inline-tabs==2023.4.21
sphinx-copybutton==0.5.2
sphinx-toolbox==3.5.0
sphinx-jsonschema==1.19.1
sphinx-notfound-page==1.1.0
8 changes: 8 additions & 0 deletions source/404.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
:orphan:

==============
Page not found
==============

The page you requested does not exist. It may have moved or been removed.
Please return to the :doc:`main page <index>`.
Comment thread
henryiii marked this conversation as resolved.
Resolved
21 changes: 21 additions & 0 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import pathlib
import sys

from docutils import nodes
from notfound.utils import replace_uris

_ROOT = pathlib.Path(__file__).resolve().parent.parent
sys.path.append(os.fspath(_ROOT))

Expand Down Expand Up @@ -35,6 +38,7 @@
"sphinx_copybutton",
"sphinx_toolbox.collapse",
"sphinx-jsonschema",
"notfound.extension",
]

nitpicky = True
Expand Down Expand Up @@ -250,3 +254,20 @@

copybutton_prompt_text = r">>> |\.\.\. |\$ |> "
copybutton_prompt_is_regexp = True

# -- Options for sphinx-notfound-page --------------------------------------------------
# https://sphinx-notfound-page.readthedocs.io/en/latest/configuration.html

# Local builds are served from the root, RtD seves from /<language>/<version>/
if not RTD_BUILD:
notfound_urls_prefix = "/"


def fix_notfound_links(app, doctree, docname):
# The extension only makes theme links absolute, not links in the page body
if app.builder.format == "html" and docname == app.config.notfound_pagename:
replace_uris(app, doctree, nodes.reference, "refuri")


def setup(app):
app.connect("doctree-resolved", fix_notfound_links)
Loading