You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I 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
Exception occurred:
File "C:\Users\Martin\AppData\Roaming\Python\Python39\site-packages\sphinx\highlighting.py", line 89, in get_style
return getattr(import_module(module), stylename)
AttributeError: module 'pygments.styles.xcode' has no attribute 'XcodeStyle2'
=> 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
Unzip the sample source code mynewbook.zip
It contains a MATLAB code block in the file mynewbook/markdown.md
And the option below in _config.yml
Observe that the code highlighting is the same with and without the pygments_style option.
To see the expected output, you can go to this page https://pygments.org/demo/
Select
Language = Matlab
Style = xcode
And paste the following code under Enter some code :
rxnList = {'PCHOLP_hs_f', 'PLA2_2_f', 'SMS_f','PCHOLP_hs_b', 'PLA2_2_b', 'SMS_b'};
c = [1, 1, 1, 1, 1, 1]; % This is a comment
d = 10;
ineqSense = 'G';
modelConstrained = constrainRxnListAboveBound(modelIrrev, rxnList, C, d, ineqSense);
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗
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).
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.
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: