-
Notifications
You must be signed in to change notification settings - Fork 659
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
Unable to change pygments_style in _config.yml #2105
Comments
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗 |
I see that you are using the Sphinx Book Theme which inherits from pydata. The pydata doc says "Configure pygments themes" using:
And,
Any difference if you use pygment_{light,dark}_style? I am having a similar issue with the sphinx_book_theme. Can't seem to change the default styles tango and monokai to anything else. If I use a nonexistent style, I get a message, "Highlighting style atest not found by pygments, falling back to tango.". But if I use a valid style from the output of |
What works for me is sphinx:
config:
html_theme_options :
pygment_light_style : "xcode"
pygment_dark_style : "monokai" |
Hello all
Describe the bug
When I add to the
_config.yml
fileI expect the style "xcode" to be used to highlight syntax in code blocks
But instead code blocks are always colored the same way, whatever the provided pygments_style
I tried to assign a class that does not exist (pygments.styles.xcode.XcodeStyle2) and this results in an error during book building
=> This suggests that the pygments style is somehow "read" (when an existing class is provided), but not used as I would expect.
I would like to customize the syntax highlighting and thus first need to check the possibility to change pygments_style before diving into custom lexer, custom style, etc.
Reproduce the bug
It contains a
MATLAB
code block in the file mynewbook/markdown.mdAnd the option below in
_config.yml
pygments_style
option.Select
Language = Matlab
Style = xcode
And paste the following code under
Enter some code :
Thanks in advance for your help and time ! :)
List your environment
Jupyter Book : 0.15.1
External ToC : 0.3.1
MyST-Parser : 0.18.1
MyST-NB : 0.17.2
Sphinx Book Theme : 1.0.1
Jupyter-Cache : 0.6.1
NbClient : 0.7.4
Python 3.9
OS : Windows 11
The text was updated successfully, but these errors were encountered: