You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have provided the necessary information about my issue.
If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('knitr'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('yihui/knitr').
If I have posted the same issue elsewhere, I have also mentioned it in this issue.
I have learned the Github Markdown syntax, and formatted my issue correctly.
I understand that my issue may be closed if I don't fulfill my promises.
Issue
When rendering with kit2wp() (and also in the Yaml header using output: github_document) the webshot package makes an image out of a dynamic HTML table, whereas the table works just fine with outputting to a html_document.
Change two chunks of the auto-generated file codebook.Rmd
First Chunk Change:
```{rsetup, include=FALSE}
knitr::opts_chunk$set(
warning=FALSE, # show warnings during codebook generationmessage=FALSE, # show messages during codebook generationerror=FALSE, # do not interrupt codebook generation in case of errors,# usually better for debuggingecho=FALSE# show R code
)
#### Last Chunk Change```{rcodebook}
compact_codebook(codebook_data)
```
Now render the rmd to Wordpress and compare to the normally-rendered HTML output
# Note need to define Wordpress credentials firstknitr::knit2wp("codebook.rmd", title="a test post")
The issue is that in webshot() the table is rendered as image, as pointed out by Ruben Arslan: rubenarslan/codebook#55
Changing knitr's behavior to generate HTML instead of a static image for the table is easy on my side, but the actual problem is that you'll have to make sure you load the correct JS libraries and CSS for the table on the WordPress site (usually in ```). That can be very tricky if you want to do it really well. We have done it in the rmarkdown package, and it's a little complicated.
Perhaps you are aware of it, but blogdown does support HTML widgets. Since knit2wp() relies on packages that are no longer actively maintained, I'd suggest you consider blogdown: #1866 (comment)
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.
By filing an issue to this repo, I promise that
xfun::session_info('knitr')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('yihui/knitr')
.I understand that my issue may be closed if I don't fulfill my promises.
Issue
When rendering with
kit2wp()
(and also in the Yaml header usingoutput: github_document
) the webshot package makes an image out of a dynamic HTML table, whereas the table works just fine with outputting to a html_document.knit2wp()
with a searchable table: Similar to codebook.html: http://janajarecki.com/codebook.htmlMinimal Working Example
Create a sample codebook
Change two chunks of the auto-generated file codebook.Rmd
First Chunk Change:
Now render the rmd to Wordpress and compare to the normally-rendered HTML output
The issue is that in
webshot()
the table is rendered as image, as pointed out by Ruben Arslan: rubenarslan/codebook#55Is there anything you can do to avoid this issue?
xfun::session_info('knitr')
The text was updated successfully, but these errors were encountered: