renderer_html: html renderer using span tags and CSS

Description Usage Arguments Value Author(s) See Also Examples

View source: R/renderer.R

Description

implementation of the renderer that renders the information as a series of <span> html tags

Usage

1
2
3
4
5
6
7
8
renderer_html(document = TRUE, translator = translator_html, 
	formatter = formatter_html, space = space_html, 
	newline = newline_html, header = header_html(document, stylesheet), 
	footer = footer_html(document), 
	stylesheet = "default" , ...)
translator_html( x, size )
space_html()
newline_html()

Arguments

document

logical. Indicates if the renderer should render a full document or simply a <pre> section containing the highlighted tokens. This argument is used by the header_html and footer_html to build appropriate header and footer.

translator

Since the highlighted tokens are wrapped in a <pre> tag, no further translation is needed.

formatter

html formatter. creates <span> tags for all tokens. See formatter_html

space

returns a space character

newline

returns a newline character

header

html header. Depending on the document argument, this will be a function building a the beginning of a complete html document (starting with <html>) including css definitions or simply a function returning <pre> enabling the renderer to be used to just render the syntax as part of a bigger document.

footer

html footer. Depending on the document argument, this will either close the full document (close the </html> tag) or simply close the </pre> tag.

stylesheet

stylesheet to use. This is used by the header when document is TRUE. The content of the stylesheet is copied verbatim into a <style> tag in that case. See getStyleFile for details on where the stylesheet can be located

x

argument to the translator. Returned as is.

size

font size. ignored

...

Additional arguments. unused.

Value

A renderer capable suitable for the renderer argument of highlight

Author(s)

Romain Francois <romain@r-enthusiasts.com>

See Also

renderer for a description of the interface this renderer is implementing.

highlight takes a renderer argument to which it delegates rendering.

Examples

1
2
3
4
	## Not run: 
		r <- renderer_html()
	
## End(Not run)

halpo/highlight documentation built on May 17, 2019, 2:26 p.m.