File: README.md

package info (click to toggle)
r-cran-highr 0.8+dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 176 kB
  • sloc: sh: 10; makefile: 7
file content (51 lines) | stat: -rw-r--r-- 1,311 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# highr

[![Build Status](https://travis-ci.org/yihui/highr.svg)](https://travis-ci.org/yihui/highr)
[![Downloads from the RStudio CRAN mirror](https://cranlogs.r-pkg.org/badges/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
\hlstd{a} \hlkwb{<-} \hlnum{1} \hlcom{\# something}
```

or HTML code

```html
<span class="hl std">a</span> <span class="hl kwb">&lt;-</span> <span class="hl num">1</span> <span class="hl com"># something</span>
```

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](http://www.andre-simon.de) 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 = 'http://rforge.net', type = 'source')
```

This package is licensed under GPL, and is supposed to serve other packages
such as [**knitr**](http://yihui.name/knitr).