How to render tinytable styled HTML tables in pkgdown examples?
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- r
- Domain
- documentation
Research direction
Reproduce the behavior with pkgdown::build_site() using the tinytable examples from VisCollin's R/tt.colldiag.R, and compare the rendered output with the RStudio Viewer result. Review the linked tinytable issue and the attempted knitr::is_html_output() and print(output = "html") approaches; done means pkgdown examples preserve the styled HTML tables instead of showing plain text tables.
Written by the indexing model from the issue text.
Description
I filed this question as an issue for tinytable: https://github.com/vincentarelbundock/tinytable/issues/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
- Dominant language
- R
- Stars
- 775
- Forks
- 355
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from r-lib/pkgdown
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
r-lib/pkgdepends#485 · 3 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
beginners blocker
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enviPathR OpenBuild Error Build OK Build Warning policies-accepted pre-review precheck-passed
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Bioconductor/BiocContributions#207 · 6 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
datacarpentry/semester-biology#1255 ·