-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Theme error: UndefinedError("'style' is undefined") #1465
Comments
Hi! I am running into the same issue trying to build libcamera's documentation on Arch Linux. |
Hi! Thanks for stopping by and reporting this! Do you have an open source repo that produces this error? There's no variables or properties in the theme's Python code called sphinx_rtd_theme/sphinx_rtd_theme/layout.html Lines 27 to 30 in 03a86b8
As you can see, this code is guarded to only be used on old versions of Sphinx. But could the variable substitution still be causing the error? |
The |
Thanks! I'm wondering why some Sphinx 7 builds work fine. For instance, this build doesn't produce the error: https://readthedocs.org/projects/test-builds/builds/20357244/ |
until readthedocs/sphinx_rtd_theme#1465 is resolved
until readthedocs/sphinx_rtd_theme#1465 is resolved
@polyzen found a fix for the libcamera issue ❤️ |
It turned out to be not sphinx_rtd_theme related (just the use of a removed keyword). Sorry for the noise! |
Thanks for sharing @dvzrv 👍 |
@benjaoming @dvzrv Hi, sorry for disturbing! I see there are still
|
@ain-soph most people who ran into this issue were running an old version of sphinx-rtd-theme. |
I agree. But it seems in the most up-to-date sphinx-rtd-theme
https://www.sphinx-doc.org/en/master/changes.html |
@ain-soph It seems to work fine with Sphinx 7 because that statement is guarded by a version clause - see: |
Oops... I didn't even notice this if condition. Quite silly I am! 😓 Thanks for your time! |
No worries, these issues are pretty complex to juggle 👍 |
For anyone else hitting this after updating to Sphinx 7, make sure to also update the theme. Working (old sphinx, old theme):
Failing (new sphinx, old theme):
Working (both sphinx and theme up to date):
|
I also encountered this as I didn't have some of my dependencies constrained and things upgraded into a failing state. I was able to use the last combination provided by @peterjc to get things working again. Thanks! |
due to a change in sphinx 7.x, there is a change required for the layout overrides to work [readthedocs/sphinx_rtd_theme](readthedocs/sphinx_rtd_theme#1465)
Problem
Getting following error when building a Sphinx project:
conf.py
includes the following:Setting
html_style
doesn't fix the issue as well.Reproducible Project
Please give a link to a public reproducible project or provide an example of the Restructured Text that gives an issue.
Error Logs/Results
#14 2.108 Theme error:
#14 2.108 An error happened in rendering the page about.
#14 2.108 Reason: UndefinedError("'style' is undefined")
Expected Results
Setting any other
html_theme
eg: 'bizstyle' works as expected.Environment Info
Happy to share the Dockerfile and Pipifile setting if the info provided is not enough.
The text was updated successfully, but these errors were encountered: