Arguments
translator
This argument should be a function with one argument. The translator
needs to work token characters so that they display nicely
in the target markup language.
formatter
The formatter should be a function with at least two arguments: the
tokens and the styles. These two arguments are supplied
to the formatter by the highlight function. The formatter should wrap
tokens and styles into the target markup language.
For example, the formatter used by the html renderer makes
a tag of class given by the styles
and content given by the token.
space
This should be a function with no argument. The output of this function
should be a character vector of length one giving the representation
of a space character in the target language. For example, in the
latex renderer, the function returns "{\ }".
newline
This should be a function with no argument. The output of the function
is a character vector of length one giving the representation of a newline
character in the target language.
header
This should be a function with no argument. The output of this function
is a character vector of arbitrary length. The elements of the output
are written before the highlighted content. headers and footers are used
to embed the highlighted tokens into some markup. For example, the header
used in the html renderer starts a tag that is closed
by the footer. headers and footer might also be used to write
style definitions such as CSS, STY, ... footer
This should be a function with no argument. The output of this function
is written after all tokens.
...
Additional arguments. This might be used to store additional renderer
specific objects.