Describe the bug
I know that Jupyter Book will not work predictably with custom Sphinx extensions, but I've been trying to integrate this Sphinx Not Found Page extension into my Jupyter Book so that I can have a custom 404 page. And I think this could be potentially useful for all Jupyter Book users.
Anyway, when I use this extension, I get the following error:
An error happened in rendering the page 404.
Reason: ValueError("'/' does not start with '/Users/melaniewalsh/mybookname'")
@humitos has been helping me debug this issue and usefully identified that there seems to be a problem in sphinx-book-theme in the function find_url_relative_to_root, which is called from generate_nav_html.
So I was wondering if there were any suggestions about how to make the Sphinx Not Found extension work with the Sphinx Book Theme. Thanks!
To Reproduce
- Add Sphinx Not Found Page extension to
_config.yml
sphinx:
extra_extensions:
- notfound.extension
config:
notfound_context:
body: "<h1>Page not found.</h1>"
notfound_no_urls_prefix: True
- Build Jupyter Book
- See error
An error happened in rendering the page 404.
Reason: ValueError("'/' does not start with '/Users/melaniewalsh/mybookname'")
Expected behavior
Custom 404 page is built that preserves CSS and JavaScript from Sphinx Book Theme
Environment
- Python Version [e.g. 3.7.1]: 3.8
- Package versions or output of
jupyter-book --version:
Jupyter Book: 0.8.2
MyST-NB: 0.10.1
Sphinx Book Theme: 0.0.36
MyST-Parser: 0.12.10
Jupyter-Cache: 0.4.1
NbClient: 0.4.0
- Operating System: Mac OS
Describe the bug
I know that Jupyter Book will not work predictably with custom Sphinx extensions, but I've been trying to integrate this Sphinx Not Found Page extension into my Jupyter Book so that I can have a custom 404 page. And I think this could be potentially useful for all Jupyter Book users.
Anyway, when I use this extension, I get the following error:
@humitos has been helping me debug this issue and usefully identified that there seems to be a problem in
sphinx-book-themein the functionfind_url_relative_to_root, which is called fromgenerate_nav_html.So I was wondering if there were any suggestions about how to make the Sphinx Not Found extension work with the Sphinx Book Theme. Thanks!
To Reproduce
_config.ymlExpected behavior
Custom 404 page is built that preserves CSS and JavaScript from Sphinx Book Theme
Environment
jupyter-book --version:Jupyter Book: 0.8.2
MyST-NB: 0.10.1
Sphinx Book Theme: 0.0.36
MyST-Parser: 0.12.10
Jupyter-Cache: 0.4.1
NbClient: 0.4.0