blob: eb006de0b7b91cc8a27128a3b44ceb2e6448aef4 [file] [log] [blame]
Hao Zhueaef4312018-01-10 17:05:23 -05001#' @export
Hao Zhub9da01c2018-01-14 21:01:57 -05002print.kableExtra <- function(x, ...) {
Hao Zhueaef4312018-01-10 17:05:23 -05003 html_header <- htmltools::tags$head(
4 rmarkdown::html_dependency_jquery(),
Hao Zhu8a69ad12018-01-10 18:01:41 -05005 rmarkdown::html_dependency_bootstrap(theme = "simplex"),
6 html_dependency_kePrint()
Hao Zhueaef4312018-01-10 17:05:23 -05007 )
Hao Zhueaef4312018-01-10 17:05:23 -05008 html_table <- htmltools::HTML(as.character(x))
Hao Zhu8c8ac8b2018-01-23 23:45:13 -05009 html_result <- htmltools::tagList(html_header, html_table)
10 htmltools::html_print(html_result)
11
12 print(html_result)
Hao Zhueaef4312018-01-10 17:05:23 -050013}
14
Hao Zhu8a69ad12018-01-10 18:01:41 -050015html_dependency_kePrint <- function() {
16 htmlDependency(name = "kePrint",
17 version = "0.0.1",
Hao Zhu7cb0e372018-01-10 18:29:30 -050018 src = system.file("kePrint-0.0.1",
Hao Zhu8a69ad12018-01-10 18:01:41 -050019 package = "kableExtra"),
20 script = "kePrint.js")
21}
Hao Zhueaef4312018-01-10 17:05:23 -050022
23#' @export
Hao Zhuc8306792018-01-11 12:34:35 -050024knit_print.kableExtra <- function(x, ...) {
Hao Zhueaef4312018-01-10 17:05:23 -050025 x <- paste0(x, "\n\n")
26 asis_output(x)
27}
28
29
30
31