Pygment background color and no highlighting

I’m using the theme robust, and when I use

pygmentsuseclasses = false
pygmentsStyle  = "monokai"

My code blocks show up with a light background color, as opposed to the dark background here . I tried using:

    pygmentsuseclasses = false

and downloading these to robust/static/css. But this simply defaults the code highlighting to the highlight.js theme chosen. The downloaded css files from I unpacked in robust/static/css which I’m symlinking to my site, and I tried: with and without the .highlight prefix, renaming monokai.css to pygments.css, and renaming monokai.css to syntax.css, but nothing worked. Any ideas to what I’m doing wrong?

Also, any ideas to how I would make a codeblock with pygments with no colorhighlighting, but simply a codeblock on a different background color with monospaced font? I tried with hightlight.js using: no-highlight or nohighlight, but these still produce code with special syntax colored. I’m interested in this because I would like to be able to show eg. terminal output in my blogposts, where I don’t want syntax highlighting.

Thanks for any help :slight_smile:

This is not an answer to your main question, but if you …

pygmentscodefences: "true"

You can youse GitHub style code fences and I believe the default hightlight is “terminal” … if not you can mark it with “bash” after the initial aposrtopphes.

“bash” could also be used with the highlight shortcode to get the “terminal” feel.

1 Like

Thanks for the tip. However, it’s still not quite optimum as “bash” still does formatting according to the syntax of shellscripting, eg.

for i in `seq 1 10`;
                echo $i

Will show up syntax highlighted, and so will most strings enclosed in quotes. I didn’t know about:

pygmentscodefences: "true"

and it’s cool, but I kinda like using both highlighting.js with triple backticks and pygments with {{< highlight language >}} as it allows me to have two different code syntax formats I can use for differentiation, for example one for generic algorithm/code examples, and one for explicit implementations.

edit: for pygments it seems that text instead of bash does the the job. I would still like to be able to change the background color of the code blocks.

I don’t get to work the background color for code blocks either. I would love to get it to work…

I managed to get this working. Check this out: