pygmentsStyle

Hi folks,

I’m trying to set a default highlighting theme for my site by placing pygmentsStyle = "solarized-light" into my config.toml file. Neither this nor pygmentsOptions = "style=solarized-light" is working.

I’d like this to theme both the codefences and the highlight shortcodes. Could the problem be theme related or am I doing it all wrong?

Thank you!

I assume you have set pygmentsuseclasses = false – meaning inline CSS styles.

So the syntax of pygmentsStyle = "solarized-light" is correct, but I suggest you try some other on https://xyproto.github.io/splash/docs/ and see if they have an effect. Maybe one is missing.

Maybe it has to do with where you’ve put pygmentsStyle = "solarized-light"in your config.toml file. This line needs to come before any arrays.

(It took me a few days to figure this out. Hoping to save you that time. :slight_smile:)

1 Like

Thank you @arjanvd! This was the solution.

Thank you @bep. Although not the cause, do you suggest I set pygmentsuseclasses = false anyway? I did use what I think translates to inline CSS and was able to get the style to work on a per usage basis. It looked like this:

{{< highlight txt "style=solarized-light" >}}

It’s a tradeoff, you need to decide. It’s certainly very practical during development to try out different styles.

Thanks, appreciate it.

(Attachment publickey - will@thewismit.com - 0xD446DF04.asc is missing)

(Attachment publickey - will@thewismit.com - 0xD446DF04.asc is missing)