rubenarslan / codebook

Cook rmarkdown codebooks from metadata on R data frames
https://rubenarslan.github.io/codebook/
Other
142 stars 16 forks source link

Make codebook table work with knit2wp and/or output:github_document [feature request] #55

Open JanaJarecki opened 4 years ago

JanaJarecki commented 4 years ago

One very cool feature would be to make codebook Rmd files work with knit2wp and/or output: github_document. Particularly, the github_document version would be cool, then one could directly view a codebook on a Github repo and e.g. sync it with the osf!

Here is a sample current output: of uploading a codebook Rmd with knit2wp (the github_document variant produces mostly the same): http://janajarecki.com/blog/codebook-for-data-in-jarecki-rieskamp-2020/

As we see, the text is pitch-perfect, but the codebook table gets transformed into a picture -- I suspect that has to do with the searchability javascript plugin of the table, but I'm not sure.

Cheers Jana

rubenarslan commented 4 years ago

Hi @JanaJarecki, not sure I can solve this on my end, but I'll think about. It happens, because knitr uses the webshot packages to make an image if we don't render to HTML. Of course, you are rendering to HTML, but indirectly via Markdown. Maybe I can catch if you're doing that and spit out a non-fancy table. Or maybe you could use rmarkdown::render with clean = F and use the resulting Markdown.

JanaJarecki commented 4 years ago

@rubenarslan thank you for the answer, clarifications, and suggestions. Anything I can do here?

Quick Feedback: knitting with clean = F and then kit2wp() with the resulting .md file produces just a <!–html_preserve–> statement, no luck here . I tried manually deleting the <!–html_preserve–> from the .md file but that doesn't render the code. Result see here, the first codebook is with manually-remoced html_preserve; the second codebook on the page is rendering from clean = F as is: http://janajarecki.com/blog/test/

JanaJarecki commented 4 years ago

Different Question: In your the tutorial - https://rubenarslan.github.io/codebook/articles/codebook.html#codebook-table-1 - you just uploaded the rendered HTML page, correct? No automatization involved, right?