Open martinSDT opened 5 months ago
Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:
I see that you are using the Sphinx Book Theme which inherits from pydata. The pydata doc says "Configure pygments themes" using:
html_theme_options = { ... "pygment_light_style": "tango", "pygment_dark_style": "monokai" }
And,
Danger The native Sphinx option pygments_style will be overwritten by this theme.
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 pygmentize -L styles
, there is no message but pygment style doesn't change either in the html output.
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
MATLAB
code block in the file mynewbook/markdown.md And the option below in_config.yml
pygments_style
option.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