Skip to content

Is there a way to specify a different pygments style per language? #1971

Answered by facelessuser
Einenlum asked this question in Q&A
Discussion options

You must be logged in to vote

Unfortunately, this is a very niche request. I don't think I've ever been asked this one.

options is more for lexer specific options that pertain to that language lexer specifically. Style is not language specific.

You could provide both CSS files and apply them based on the language class. You can force language class to be assigned to the block by enabling pygments_lang_class. As you would be attempting to override material, you may have to add some !importants to your CSS.

I'm not sure it makes sense to add style to the language-specific options. Adding such a feature would not be a commonly used feature.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Einenlum
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants