blob: 93d090948845265ee2538ee4becd2be1735dd08b [file] [log] [blame]
Hao Zhueaef4312018-01-10 17:05:23 -05001#' @export
2print.kableExtra <- function(x) {
3 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 )
8
9 html_table <- htmltools::HTML(as.character(x))
10 cat(as.character(x))
11 htmltools::html_print(htmltools::tagList(html_header, html_table))
12}
13
Hao Zhu8a69ad12018-01-10 18:01:41 -050014html_dependency_kePrint <- function() {
15 htmlDependency(name = "kePrint",
16 version = "0.0.1",
Hao Zhu7cb0e372018-01-10 18:29:30 -050017 src = system.file("kePrint-0.0.1",
Hao Zhu8a69ad12018-01-10 18:01:41 -050018 package = "kableExtra"),
19 script = "kePrint.js")
20}
Hao Zhueaef4312018-01-10 17:05:23 -050021
22#' @export
Hao Zhuc8306792018-01-11 12:34:35 -050023knit_print.kableExtra <- function(x, ...) {
Hao Zhueaef4312018-01-10 17:05:23 -050024 x <- paste0(x, "\n\n")
25 asis_output(x)
26}
27
28
29
30