mara
April 3, 2018, 12:23pm
2
The comment symbol is #
in R code. You can explicitly set a comment character (or character combination) in an RMarkdown document as a parameter, if you so choose. Bookdown uses pygments, I believe, for syntax highlighting, which might be different from what you use in another RMarkdown-generated thing (e.g. for blogdown I use highlight.js).
opened 04:58AM - 21 Jun 17 UTC
closed 07:44PM - 06 Jul 17 UTC
After being directed to the bookdown upon creating my first issue (the answer to… my problem was sitting there quite obviously) I took my time looking around (Hugo forums, GitHub) however still lacking the solution for my syntax highlighting problem.
Basically, I want to use pygments to be able to manipulate class colors (with `pygmentsuseclasses = true`. However, I cannot seem to find where to pass [Hugo's highlight](https://gohugo.io/extras/highlighting/) function in blogdown. I have the library on the path.
Highligth.js works fine with a customized .css, but syntax like operators, functions etc. do not span their own class. This [post](http://www.data-imaginist.com/2017/Animating-the-logo/) for example has the functionality I want (just inspect any code chunk), however it was built by Jekyll. He seems to pass {% highlight r %} before the code. How can I do that with blogdown? Thanks.
Using the #
symbol for comments is pretty well-established, so I'd recommend using it over >
which often indicates a prompt in the R console.
http://r.789695.n4.nabble.com/How-to-comment-in-R-td882882.html
1 Like