html_pretty
in the prettydoc
package is a new output format for creating HTML documents from R Markdown files.
html_pretty
is more lightweight compared to html_document
, and is more
stylish than html_vignette
when creating package vignettes.
html_pretty
currently supports three page themes (cayman
, tactile
and
architect
), and two syntax highlight styles (github
and vignette
).
The theme and highlight styles can be specified in the document metadata,
for example:
output: prettydoc::html_pretty: theme: architect highlight: github
Feel free to use the knitr
infrastructure with dozens of tunable options in
your document.
set.seed(123) n <- 1000 x1 <- matrix(rnorm(n), ncol = 2) x2 <- matrix(rnorm(n, mean = 3, sd = 1.5), ncol = 2) x <- rbind(x1, x2) head(x) smoothScatter(x, xlab = "x1", ylab = "x2")
You can include code snippets of languages other than R, but note that the block header has no curly brackets around the language name.
// [[Rcpp::export]] NumericVector timesTwo(NumericVector x) { return x * 2; }
You can also write math expressions, e.g. $Y = X\beta + \epsilon$,
footnotes^[A footnote here.], and tables, e.g. using knitr::kable()
.
knitr::kable(head(iris, 10))
Please visit the development page of the
prettydoc
package for latest updates and news. Comments, bug reports and
pull requests are always welcome.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.