diff --git a/NAMESPACE b/NAMESPACE index ff334091..b7394fa6 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,5 +1,6 @@ # Generated by roxygen2: do not edit by hand +S3method(knitr::knit_print, tinytable) S3method(print,tinytable) export(format_tt) export(group_tt) diff --git a/R/print.R b/R/print.R index e0a712f0..4a5f0f8c 100644 --- a/R/print.R +++ b/R/print.R @@ -1,6 +1,7 @@ #' Print a tinytable object in knitr #' #' @keywords internal +#' @rawNamespace S3method(knitr::knit_print, tinytable) #' @return A string with class `knit_asis` to be printed in Rmarkdown or Quarto documents. #' @export knit_print.tinytable <- function(x, diff --git a/R/zzz.R b/R/zzz.R index 76f5d54a..d4564bd9 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -1,5 +1,8 @@ -.onLoad <- function(libname, pkgname) { - if (requireNamespace("knitr", quietly = TRUE)) { - registerS3method("knit_print", "tinytable", knit_print.tinytable, envir = asNamespace("knitr")) - } -} +# replaced this with @rawNamespace S3method(knitr::knit_print, tinytable) in print.R + + +# .onLoad <- function(libname, pkgname) { +# if (requireNamespace("knitr", quietly = TRUE)) { +# registerS3method("knit_print", "tinytable", knit_print.tinytable, envir = asNamespace("knitr")) +# } +# }