blob: a33b61dad96b2e155c56a16c55745af40d49655d [file] [log] [blame]
Hao Zhueaef4312018-01-10 17:05:23 -05001#' @export
Hao Zhub9da01c2018-01-14 21:01:57 -05002print.kableExtra <- function(x, ...) {
Hao Zhuf2100832018-01-11 16:20:29 -05003 cat(as.character(x))
Hao Zhueaef4312018-01-10 17:05:23 -05004 html_header <- htmltools::tags$head(
5 rmarkdown::html_dependency_jquery(),
Hao Zhu8a69ad12018-01-10 18:01:41 -05006 rmarkdown::html_dependency_bootstrap(theme = "simplex"),
7 html_dependency_kePrint()
Hao Zhueaef4312018-01-10 17:05:23 -05008 )
Hao Zhueaef4312018-01-10 17:05:23 -05009 html_table <- htmltools::HTML(as.character(x))
Hao Zhueaef4312018-01-10 17:05:23 -050010 htmltools::html_print(htmltools::tagList(html_header, html_table))
11}
12
Hao Zhu8a69ad12018-01-10 18:01:41 -050013html_dependency_kePrint <- function() {
14 htmlDependency(name = "kePrint",
15 version = "0.0.1",
Hao Zhu7cb0e372018-01-10 18:29:30 -050016 src = system.file("kePrint-0.0.1",
Hao Zhu8a69ad12018-01-10 18:01:41 -050017 package = "kableExtra"),
18 script = "kePrint.js")
19}
Hao Zhueaef4312018-01-10 17:05:23 -050020
21#' @export
Hao Zhuc8306792018-01-11 12:34:35 -050022knit_print.kableExtra <- function(x, ...) {
Hao Zhueaef4312018-01-10 17:05:23 -050023 x <- paste0(x, "\n\n")
24 asis_output(x)
25}
26
27
28
29