Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yihui/highr
Syntax Highlighting for R Source Code
https://github.com/yihui/highr
html latex r r-package syntax-highlighting
Last synced: 13 days ago
JSON representation
Syntax Highlighting for R Source Code
- Host: GitHub
- URL: https://github.com/yihui/highr
- Owner: yihui
- Created: 2013-07-04T08:32:18.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2024-04-28T20:39:38.000Z (7 months ago)
- Last Synced: 2024-05-08T16:03:00.009Z (6 months ago)
- Topics: html, latex, r, r-package, syntax-highlighting
- Language: R
- Homepage: https://cran.rstudio.com/package=highr
- Size: 102 KB
- Stars: 44
- Watchers: 8
- Forks: 16
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - yihui/highr - Syntax Highlighting for R Source Code (R)
README
# highr
[![R-CMD-check](https://github.com/yihui/highr/workflows/R-CMD-check/badge.svg)](https://github.com/yihui/highr/actions)
[![CRAN release](https://www.r-pkg.org/badges/version/highr)](https://cran.r-project.org/package=highr)This is an infrastructure R package for syntax highlighting. It supports
LaTeX and HTML output. Not surprisingly, it works best with R code. It
attaches markups onto source code, e.g., it turns```r
a <- 1 # something
```into LaTeX code
```latex
\hldef{a} \hlkwb{<-} \hlnum{1} \hlcom{\# something}
```or HTML code
```html
a <- 1 # something
```via
```r
library(highr)
hi_latex("a <- 1 # something")
hi_html("a <- 1 # something")
# or hilight(code, format = "latex"/"html")
```This package also has a wrapper function, `hi_andre()`, for Andre Simon's
[Highlight](https://gitlab.com/saalen/highlight) package.There are a few package Markdown vignettes in this package:
```r
browseVignettes(package = "highr")
```To install the development version here, use
```r
install.packages('highr', repos = 'https://yihui.r-universe.dev')
```This package is licensed under GPL, and was originally designed for serving other packages
such as [**knitr**](http://yihui.org/knitr/).