as_html.spar {spork} | R Documentation |
Convert One Spork to Html
Description
Converts one spork to html.
See description for as_spork
.
By default, unrecognized tokens are returned
literally. However, Greek symbols and html
metacharacters are escaped.
See htmlToken
.
Usage
## S3 method for class 'spar'
as_html(
x,
newline = getOption("html_newline", "<br/>"),
unrecognized = getOption("html_unrecognized", spork::htmlToken),
token_open = getOption("html_token_open", ""),
token_close = getOption("html_token_close", ""),
math_open = getOption("html_math_open", ""),
math_close = getOption("html_math_close", ""),
label_open = getOption("html_label_open", ""),
label_close = getOption("html_label_close", ""),
...
)
Arguments
x |
spar |
newline |
value to replace |
unrecognized |
function to process unrecognized tokens: default |
token_open , token_close |
these wrap text-like portions of the label; the defaults try to give upright characters (non-italic); also passed to |
math_open , math_close |
these wrap math-like portions of the label; the defaults try to give upright characters (non-italic) which may not work for Greek symbols; also passed to |
label_open , label_close |
these wrap the entire label |
... |
passed to |
Details
Experimental support is implemented for
the newline character ('\n'
).
Default behavior is to introduce linebreaks
(<br/>) into the resulting
html.
Value
html
See Also
Other interface:
as.expression.plotmath()
,
as_html.spork()
,
as_latex.spar()
,
as_latex.spork()
,
as_plotmath.spar()
,
as_plotmath.spork()
,
as_previews.spork()
,
as_spork.character()
,
htmlToken()
,
latexToken()
,
plotmathToken()
Other html:
[.html()
,
[[.html()
,
as_html.greek()
,
as_html.spork()
,
as_html()
,
html2xml()
,
htmlToken()
Examples
library(magrittr)
'V_c./F' %>% as_spork %>% as_html
'AUC_ss' %>% as_spork %>% as_html
'C_max_ss' %>% as_spork %>% as_html
'var^eta_j' %>% as_spork %>% as_html
'& < % $ # \\_ { } ~ \\^ \\' %>% as_spork %>% as_html
'one joule (Omega) ~ 1 kg*m^2./s^2' %>% as_spork %>% as_html
'one joule (`Omega`) ~ 1 kg*m^2./s^2' %>% as_spork %>% as_html
'one joule (\\`Omega\\`) ~ 1 kg*m^2./s^2' %>% as_spork %>% as_html