matt
January 28, 2022, 2:57pm
1
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?
maelle
January 31, 2022, 6:48am
2
It might be worth opening an issue as I'm not sure one can turn off syntax highlighting.
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
matt
January 31, 2022, 10:57pm
3
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 Like
system
Closed
February 21, 2022, 10:58pm
4
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.