Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nanxstats/shiny-highlight-rmarkdown
Lightweight R Markdown Syntax Highlighting in Shiny
https://github.com/nanxstats/shiny-highlight-rmarkdown
highlightjs rmarkdown shiny syntax-highlighting
Last synced: about 2 months ago
JSON representation
Lightweight R Markdown Syntax Highlighting in Shiny
- Host: GitHub
- URL: https://github.com/nanxstats/shiny-highlight-rmarkdown
- Owner: nanxstats
- License: mit
- Created: 2021-08-07T06:03:52.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-03T16:39:43.000Z (almost 3 years ago)
- Last Synced: 2024-11-15T01:33:45.510Z (about 2 months ago)
- Topics: highlightjs, rmarkdown, shiny, syntax-highlighting
- Language: JavaScript
- Homepage: https://nanx.shinyapps.io/shiny-highlight-rmarkdown/
- Size: 78.1 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-shiny-extensions - shiny-highlight-rmarkdown - R code and R Markdown code output syntax highlighting using highlight.js. (UI Components / Special Input)
README
# 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
or
```r
shiny::runGitHub("nanxstats/shiny-highlight-rmarkdown", ref = "main")
```## Why
- [shiny:::showcaseUI](https://github.com/rstudio/shiny/blob/master/R/showcase.R)
and [codeModules::renderCode](https://github.com/statistikat/codeModules)
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
- Modified from [codeModules::renderCode](https://github.com/statistikat/codeModules)
- 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`](https://github.com/rstudio/shiny/blob/master/inst/www/shared/highlight/rstudio.css)## License
MIT