Syntax Highlighting of R-Code using Blogdown
As I’m moving this blog from wordpress to blogdown (also see the book about blogdown) I was wonderung how I can get some nice syntax highlighting of the embedded R-code.
The first impression was quite sobering. I used the default .Rmd page type and I got not much highlighting. It was better than that I got at Medium with base functionality. But it’s not quite what I wanted.
But there are two other file types in blogdown.
.md is for simple markdown-pages without any R-code. But the other one .Rmarkdown seems to be more promising.
.Rmarkdown pages are compiled by Hugo instead of pandoc (see https://bookdown.org/yihui/blogdown/output-format.html for details.)
So the result is quite pretty.
|
|
But there was one thing I had to enable in the Hugo-theme I’m using:
I had to enable a functionality in the file config.toml
:
|
|