From 507647d164c0aa6bc2d4e35c6b69b1c5e7bf0053 Mon Sep 17 00:00:00 2001 From: Philipp Horstenkamp Date: Wed, 13 Sep 2023 19:01:09 +0200 Subject: [PATCH] Added custom 404 error code page in the sphinx docs (#115) --- documentations/conf.py | 3 +++ poetry.lock | 49 +++++++++++++++++++++--------------------- pyproject.toml | 2 +- 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/documentations/conf.py b/documentations/conf.py index 7f6dfc7..e23b762 100644 --- a/documentations/conf.py +++ b/documentations/conf.py @@ -43,6 +43,7 @@ extensions: Final[list[str]] = [ "sphinx.ext.viewcode", "IPython.sphinxext.ipython_console_highlighting", "sphinxcontrib.mermaid", + "notfound.extension", ] # templates_path : Final[list[str]] = ["_templates"] @@ -86,3 +87,5 @@ intersphinx_mapping: Final[dict[str, tuple[str, None]]] = { "scikit-learn": ("https://scikit-learn.org/stable/", None), "sphinx": ("https://docs.sympy.org/latest/", None), } + +notfound_urls_prefix = "/" diff --git a/poetry.lock b/poetry.lock index 16ee761..095c857 100644 --- a/poetry.lock +++ b/poetry.lock @@ -3366,26 +3366,6 @@ files = [ [package.dependencies] ptyprocess = ">=0.5" -[[package]] -name = "pgeocode" -version = "0.4.1" -description = "Approximate geocoding" -category = "main" -optional = false -python-versions = ">=3.8" -files = [ - {file = "pgeocode-0.4.1-py3-none-any.whl", hash = "sha256:0cc3916d75c41ffcd910ccc2252235a66c627346502cba5d2e97b6ea0aa83257"}, - {file = "pgeocode-0.4.1.tar.gz", hash = "sha256:08f35dedf79957769641c7137aa9cc189e1bb63033226372dce372b14973e8b2"}, -] - -[package.dependencies] -numpy = "*" -pandas = "*" -requests = "*" - -[package.extras] -fuzzy = ["thefuzz"] - [[package]] name = "pickleshare" version = "0.7.5" @@ -4914,20 +4894,20 @@ win32 = ["pywin32"] [[package]] name = "setuptools" -version = "68.2.0" +version = "68.2.1" description = "Easily download, build, install, upgrade, and uninstall Python packages" category = "main" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-68.2.0-py3-none-any.whl", hash = "sha256:af3d5949030c3f493f550876b2fd1dd5ec66689c4ee5d5344f009746f71fd5a8"}, - {file = "setuptools-68.2.0.tar.gz", hash = "sha256:00478ca80aeebeecb2f288d3206b0de568df5cd2b8fada1209843cc9a8d88a48"}, + {file = "setuptools-68.2.1-py3-none-any.whl", hash = "sha256:eff96148eb336377ab11beee0c73ed84f1709a40c0b870298b0d058828761bae"}, + {file = "setuptools-68.2.1.tar.gz", hash = "sha256:56ee14884fd8d0cd015411f4a13f40b4356775a0aefd9ebc1d3bfb9a1acb32f1"}, ] [package.extras] docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-hoverxref (<2)", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] -testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] +testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.1)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] [[package]] name = "shapely" @@ -5131,6 +5111,25 @@ sphinx = ">=1.8" code-style = ["pre-commit (==2.12.1)"] rtd = ["ipython", "myst-nb", "sphinx", "sphinx-book-theme", "sphinx-examples"] +[[package]] +name = "sphinx-notfound-page" +version = "1.0.0" +description = "Sphinx extension to build a 404 page with absolute URLs" +category = "dev" +optional = false +python-versions = ">=3.8" +files = [ + {file = "sphinx_notfound_page-1.0.0-py3-none-any.whl", hash = "sha256:40a5741a6b07245a08fe55dbbd603ad6719e191b1419ab2e5337c706ebd16554"}, + {file = "sphinx_notfound_page-1.0.0.tar.gz", hash = "sha256:14cd388956de5cdf8710ab4ff31776ef8d85759c4f46014ee30f368e83bd3a3b"}, +] + +[package.dependencies] +sphinx = ">=5" + +[package.extras] +doc = ["sphinx-autoapi", "sphinx-rtd-theme", "sphinx-tabs", "sphinxemoji"] +test = ["tox"] + [[package]] name = "sphinx-rtd-theme" version = "1.3.0" @@ -5914,4 +5913,4 @@ ingest = ["selenium"] [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "f15e3b3171f0b6b22635f5c9de7635114c99447c5b3d41f8b1596d005fe1dce8" +content-hash = "8bb7730a3c0b9881f7d4cdadff6d1edadfec8e4244be0c530f072bd8ea17dc15" diff --git a/pyproject.toml b/pyproject.toml index b69d034..cb0c2be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,6 @@ dash-bootstrap-components = "^1.5.0" deutschland = {git = "https://github.com/TrisNol/deutschland.git", branch = "hotfix/python-3.11-support"} loguru = "^0.7.0" matplotlib = "^3.7.2" -pgeocode = "^0.4.0" plotly = "^5.16.1" psycopg2-binary = "^2.9.7" pymongo = "^4.5.0" @@ -69,6 +68,7 @@ myst-parser = "^1.0.0" nbsphinx = "^0.9.2" sphinx = "*" sphinx-copybutton = "^0.5.2" +sphinx-notfound-page = "^1.0.0" sphinx-rtd-theme = "^1.3.0" sphinx_autodoc_typehints = "*" sphinxcontrib-mermaid = "^0.9.2"