-
Notifications
You must be signed in to change notification settings - Fork 340
Description
I filed this question as an issue for tinytable: vincentarelbundock/tinytable#624
but perhaps the solution is more directly related to pkgdown.
Brief Description
When using tinytable in function examples that are rendered by pkgdown::build_site(), the tables appear as plain text/markdown tables rather than styled HTML tables with colors and backgrounds. This makes it difficult to showcase the visual styling capabilities of tinytable in package documentation.
Current Behavior
In my package VisCollin, I have a function tt.colldiag() that creates styled tables with background colors and variable font sizes:
https://github.com/friendly/VisCollin/blob/master/R/tt.colldiag.R
When I run an example in the RStudio console, this is what appears in the Viewer tab, which is what I want
When I run pkgdown::build_site(), the examples execute but the output appears as plain text tables instead of rendered HTML with the styling preserved.
What I've Tried
-
Setting output option conditionally:
if (knitr::is_html_output()) options(tinytable_print_output = "html")
Result: No effect in pkgdown examples
-
Explicitly calling print with output parameter:
tt(cd) |> print(output = "html")
Result: Error:
xmust be a data.frame` -
Checking tinytable's own pkgdown site:
Even the tinytable documentation examples section appears to show only code, not rendered styled tables