Skip to content

nanxstats/shiny-highlight-rmarkdown

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
R
 
 
 
 
 
 
 
 
 
 
 
 

shiny-highlight-rmarkdown

Offers renderRmd() and rmdOutput(): syntax highlighting for R Markdown output in Shiny using highlight.js.

Also offers renderRcode() and rcodeOutput() for R code output syntax highlighting.

You can use either one independently or use the two together.

Demo

https://nanx.shinyapps.io/shiny-highlight-rmarkdown/

or

shiny::runGitHub("nanxstats/shiny-highlight-rmarkdown", ref = "main")

Why

  • shiny:::showcaseUI and codeModules::renderCode offer an R syntax highlighting solution but do not support R Markdown.
  • Sometimes you want a lightweight R or R Markdown syntax highlighting solution in Shiny that does not involve introducing dependencies such as shinyAce.

How

First, they take the dinglebop, and they smooth it out with a bunch of schleem.

  • R
  • JS/CSS
    • highlight.js
    • Modified version of the Markdown language highlighter markdown.min.js
    • Modified version of the R language highlighter r.min.js
    • Original version of the YAML language highlighter yaml.min.js
    • Original version of the LaTeX language highlighter latex.min.js
    • Modified version of github.min.css theme based on colors in rstudio.css

License

MIT