-
Notifications
You must be signed in to change notification settings - Fork 755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build_readme()
rejects (and fails with) HTML-based output
#2533
Comments
Yeah GitHub-flavored markdown is never going to play nicely with your flextables. The "basic markdown" vibe is intentional for Most people allow
https://pkgdown.r-lib.org/reference/build_home.html#home-page I think this is not a problem we can solve for you in devtools, but I think you can solve it with more work on the pkgdown side. |
Late to the story here, but I have found this works for me if I use webshot, not webshot2. I believe knitr looks first for webshot2, so if you have it installed, you need to uninstall it. And webshot requires phantomjs: # remove.packages("webshot2") # If it is installed
install.packages("webshot")
webshot::install_phantomjs()
devtools::build_readme() This successfully renders html output (mapview) to pngs in my README eg here. Re webshot2, I think there is an issue properly launching chromote in some situations, but I can't find where that is now... Edit: This doesn't solve the rendering of html in pkgdown, but does automatically create the pngs in the README.md |
Description of Problem
I am working on building a package that is designed for a rather narrow audience. Part of the package generates plots (ggplots, to be specific) and I have no problem with these. The other part of the package generates
flextable
objects.Edit: here is the package
From what I understand,
build_readme()
generates plots and saves them as images, saving them to theman/figures/
directory for use by theREADME.md
. However, I do not see this type of behavior with HTML content, such as myflextable
s (and I assume this also applies tokable
s. It seems that gitHub-flavored markdown does not like many HTML tags, including<style>
so my table outputs are not rendered at all when converting fromREADME.Rmd
toREADME.md
.I'm not sure if this is a true "issue" with the package or if I just need to think outside of the box a little. But, in my head, I'd love it if
build_readme()
would usewebshot
(orwebshot2
) to snap a picture of the generated table for use in GitHub documents and would just use the normal HTML for my package's documentation site online.Right now, I'm saving my
flextable
s as pngs and importing them manually into theREADME.md
file (so my .Rmd and .md files are not equivalent which I'd like to avoid). It's not exactly feasible to keep generating table images every time I change a function :D.I'll try my best to put a reproducible example of my
README.Rmd
but it may be tricky since I'm operating in a package environment. Packages needed aredplyr
,flextable
, andknitr
as well as the pipe,%>%
.Example Function
Example README.Rmd
Here is how to use this function.
Any help or discussion is much appreciated!
The text was updated successfully, but these errors were encountered: