rstudio/revealjs

Supports highlightjs using RevealHighlight or usual R Markdown way ?

cderv opened this issue · 2 comments

cderv commented

R Markdown has current usually support for highlight.js through highlight: paramater: https://pkgs.rstudio.com/rmarkdown/reference/html_document.html

revealjs currently only support Pandoc's syntax highlighting through the rmarkdown::pandoc_highlight_args() function.

However, the template already have the loading of the library but it is not really included and I don't think that works

$if(highlightjs)$
<link rel="stylesheet"
href="$highlightjs$/$if(highlightjs-theme)$$highlightjs-theme$$else$default$endif$.css"
$if(html5)$$else$type="text/css" $endif$/>
<script src="$highlightjs$/highlight.js"></script>
$endif$

Also, reveal.js seems to have support through a Plugin : https://revealjs.com/code/
This brings features like

cderv commented

I think the above is really old code that was once used in rmarkdown but removed in rmarkdown 1.2
rstudio/rmarkdown@d4aaf99
following the switch to use highlightjs with htmldependency

We should use the revealjs way IMO

cderv commented

Currently, highlightjs is never used because of

# highlight
args <- c(args, pandoc_highlight_args(highlight, default = "pygments"))

which will only set Pandoc's highlighting.

In rmarkdown, highlightjs can be triggered using rmarkdown:::pandoc_html_highlight_args() and the default template.

So I believe no risk to remove this from the template.