styler: Style definition generator

View source: R/renderer.R

stylerR Documentation

Style definition generator


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


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



name of the stylesheet


extension of the language specific format for the stylesheet.


function to which the styler delegates understanding of the parser output


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.


a character vector containing style declarations in the target language

See Also

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


## Not run: 
	styler( "default", "sty", styler_assistant_latex )

## End(Not run)

highlight documentation built on Jan. 22, 2023, 1:38 a.m.