-
Notifications
You must be signed in to change notification settings - Fork 0
/
html_doc_2.R
48 lines (45 loc) · 1.41 KB
/
html_doc_2.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#' start to abuse to html_document
#'
#' The next simplest thing we can do is change the defaults for
#' \code{code_folding} and theme, add some css for the title,
#' then pass the rest of our arguments to
#' \code{rmarkdown::\link[rmarkdown]{html_document}}
#'
#' Any css you send using the `css` argument will be appended
#' to the title css.
#'
#' @param code_folding Enable document readers to toggle the
#' display of R code chunks. We change the default to \code{"hide"}.
#' See \code{rmarkdown::\link[rmarkdown]{html_document}}
#' @param theme Use to change the theme
#' @param css One or more css files to include in addition
#' to this format's css.
#' @param ... other arguments passed to
#' \code{rmarkdown::\link[rmarkdown]{html_document}}
#'
#' @return R Markdown output format to pass to
#' \code{rmarkdown::\link[rmarkdown]{render}}
#'
#' @seealso \url{http://rmarkdown.rstudio.com/developer_custom_formats.html}
#'
#' @examples
#' \dontrun{
#' rmarkdown::render("foo.Rmd", html_doc_2())
#' }
#' @export
#
html_doc_2 <- function(code_folding = c("hide", "show", "none"),
theme = "readable", css = NULL, ...){
code_folding <- match.arg(code_folding)
# append supplied css to our css
css <- c(
system.file("css", "comic_sans.css", package = "user2016docdemo"),
css
)
rmarkdown::html_document(
code_folding = code_folding,
theme = theme,
css = css,
...
)
}