rdocumentation-2.0 icon indicating copy to clipboard operation
rdocumentation-2.0 copied to clipboard

Add syntax highlighting for R code?

Open ncarchedi opened this issue 4 years ago • 1 comments
trafficstars

The easiest way to do this is probably via react-syntax-highlighter, but I couldn't find an existing theme that I felt matched the style of the rest of the site well enough: https://github.com/remarkjs/react-markdown#use-custom-renderers-syntax-highlight

ncarchedi avatar Jan 06 '21 15:01 ncarchedi

Thanks for your work!

Syntax highlighting would be very helpful. Here is a react-syntax-highlighter demo that lets you flip through common themes: https://react-syntax-highlighter.github.io/react-syntax-highlighter/demo/

There is a couple I like with other languages but not with R. It seems like the R grammar for highlight.js is not very expressive.

Nonetheless I find non-highlighted code hard to read quickly, so I think any theme would be helpful.

nx10 avatar Jun 04 '21 14:06 nx10