styler: Style definition generator

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/renderer.R

Description

This generates style definitions either by including a language specific style file (e.g. sty file for latex) or by parsing a css stylesheet

Usage

1
styler(stylesheet, extension = "css", assistant)

Arguments

stylesheet

name of the stylesheet.

extension

extension of the language specific format for the stylesheet.

assistant

function to which the styler delegates understanding of the parser output

Details

First, the function attempts to retrieve a language specific stylesheet using the getStyleFile function. If a language specific stylesheet is found, it returns the content of the file as a character vector.

Second, the function attemps to find a css stylesheet using getStyleFile, parse the css declarations using the css.parser function, and delegates to the assistant which is responsible to translate the results of the css parser into language specific declarations.

Value

a character vector containing style declarations in the target language

Author(s)

Romain Francois <romain@r-enthusiasts.com>

See Also

styler_assistant_latex gives a concrete implementation of the assistant for the latex language

Examples

1
2
3
4
	## Not run: 
		styler( "default", "sty", styler_assistant_latex )
	
## End(Not run)

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