Remove syntax highlighting from {pkgdown} site

How do you deactivate syntax highlighting from a {pkgdown} site?

I'd like code blocks on my site to to be rendered according to the {bslib} declarations in my _pkgdown.yml file ( code-font, code-bg, etc).

Syntax highlighting is mentioned the {pkgdown} docs:

Theme with a dark background (e.g. cyborg, darkly, solar) will also need a different syntax highlight theme .

But this seems to be in the context of having selected a bootswatch theme (which I'm not using) and doesn't describe how to 'turn off' the highlighting.

Perhaps I'm missing something more obvious?

It might be worth opening an issue as I'm not sure one can turn off syntax highlighting. :thinking:

However, even if the classes are applied, you can add some CSS rules (in pkgdown/extra.css or pkgdown/extra.scss) based on an existing theme e.g.pkgdown/atom-one-dark.scss at main · r-lib/pkgdown · GitHub where you replace all colors with something like "inherit".

1 Like

Thank you, Maëlle. I've now raised an issue as you suggested.

In the meantime I've found the theme 'monochrome' that almost meets my needs. I'll probably end up tweaking it using the approach you suggested. :+1:

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.