highlight renderer using xterm 256 escape sequences

Description

This function creates a renderer suitable for the renderer argument of the highlight function using style to decorate the tokens with background and foreground color.

Usage

1
2
3
4
5
6
7
8
renderer_xterm(translator = translator_xterm, 
	formatter = formatter_xterm(stylesheet = stylesheet), 
	space = space_xterm, newline = newline_xterm, 
	header = NULL, footer = NULL, stylesheet = "default", ...)
translator_xterm(x)
formatter_xterm( stylesheet )
newline_xterm()
space_xterm()

Arguments

translator

translator. No translation is performed. The function simply returns its argument

formatter

formatter. This function will decorate the tokens together with the styles decided by the detective using the information contained in the stylesheet

space

Function that returns a space character.

newline

Function that returns a new line character.

header

Empty header

footer

Empty footer

stylesheet

The stylesheet to use. This will be parsed by the css.parser function and the information contained will be used by the formatter. Only background and foreground colors (css settings color and background) are currently honored by the formatter.

...

Additional arguments

x

input of the translator. Returned as is.

Value

a renderer object suitable for the renderer argument of the highlight function

Author(s)

Romain Francois <francoisromain@free.fr>

See Also

The renderer is actually built by the renderer function.

The css.parser is used to parse the css stylesheet

The style function is used to decorate the tokens with background and foreground color.

The print.function function uses this renderer to pretty print functions.

Examples

1
2
3
4
5
6
	## Not run: 
		r <- renderer_xterm( )
		highlight( parser.output = parser( text = deparse(jitter) ), 
			renderer = r, detective = simple_detective )
	
## End(Not run)