Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: sphinx-notfound-page doesn't show nicer 404 page #125895

Open
nineteendo opened this issue Oct 23, 2024 · 4 comments
Open

Docs: sphinx-notfound-page doesn't show nicer 404 page #125895

nineteendo opened this issue Oct 23, 2024 · 4 comments
Labels
docs Documentation in the Doc dir

Comments

@nineteendo
Copy link
Contributor

nineteendo commented Oct 23, 2024

Documentation

The sphinx not found extension introduced in #111084 doesn't seem to be installed when the documentation is published: https://docs.python.org/3/-

Screenshot 2024-10-23 at 21 43 31

This is how it's meant to look: https://cpython-previews.readthedocs.io/en/3.14/-

Screenshot 2024-10-23 at 21 43 12

cc @hugovk

@nineteendo nineteendo added the docs Documentation in the Doc dir label Oct 23, 2024
@hugovk
Copy link
Member

hugovk commented Oct 23, 2024

I can see the extension is installed in the venv on the docs server, for example:

./venv-3.14/lib/python3.10/site-packages/sphinx_notfound_page-1.0.4.dist-info
./venv-3.14/lib/python3.10/site-packages/sphinx_notfound_page-1.0.4.dist-info/RECORD
./venv-3.14/lib/python3.10/site-packages/sphinx_notfound_page-1.0.4.dist-info/WHEEL
./venv-3.14/lib/python3.10/site-packages/sphinx_notfound_page-1.0.4.dist-info/INSTALLER
./venv-3.14/lib/python3.10/site-packages/sphinx_notfound_page-1.0.4.dist-info/LICENSE
./venv-3.14/lib/python3.10/site-packages/sphinx_notfound_page-1.0.4.dist-info/REQUESTED
./venv-3.14/lib/python3.10/site-packages/sphinx_notfound_page-1.0.4.dist-info/METADATA
./venv-3.14/lib/python3.10/site-packages/notfound
./venv-3.14/lib/python3.10/site-packages/notfound/__pycache__
./venv-3.14/lib/python3.10/site-packages/notfound/__pycache__/__init__.cpython-310.pyc
./venv-3.14/lib/python3.10/site-packages/notfound/__pycache__/extension.cpython-310.pyc
./venv-3.14/lib/python3.10/site-packages/notfound/__pycache__/utils.cpython-310.pyc
./venv-3.14/lib/python3.10/site-packages/notfound/__init__.py
./venv-3.14/lib/python3.10/site-packages/notfound/extension.py
./venv-3.14/lib/python3.10/site-packages/notfound/utils.py

I'm not sure what's up, perhaps it's some Nginx config?

But at least it is useful on the previews, and there is a plan to host the docs on Read the Docs: python/docs-community#5.

@AA-Turner
Copy link
Member

It's because the prefix defaults to /en/latest.

Ideally there would be a way to define this via a pattern (e.g. /{language}/{version}/), but currently it is only a static string.

We can't use that static string because we don't know the language ahead of time though, as we use -D language=XX on the command line. So I don't see a good way of resolving this.

A

@hugovk
Copy link
Member

hugovk commented Nov 1, 2024

It's useful for RTD previews, so I suggest we either leave it be, or only install it for RTD builds.

It's not a heavy dependency, so I lean towards leaving it be.

@nineteendo
Copy link
Contributor Author

We can't use that static string because we don't know the language ahead of time though, as we use -D language=XX on the command line.

Can't you use an environment variable, as those can be retrieved in conf.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
Status: Todo
Development

No branches or pull requests

3 participants