Closed jayhesselberth closed 3 years ago
The rationale for writing repr instead of using knitr: https://github.com/r-lib/pkgdown/issues/959#issuecomment-453553830
I like having modular general-purpose packages that are agnostic towards from where they’re used. knitr’s knit_print
is all but that.
@flying-sheep can you confirm how/if repr supports gganimate objects? Sorry if I'm rehashing, can't remember if this came up. I assume you would add a generic in repr?
Sorry, idk about gganimate. It generally supports htmlwidgets if that matters. To support anything, you implement repr_<format>.<class>
, I assume in this case a repr_html.gif_image
function or so.
I hacked my way around it for dm in https://github.com/krlmlr/dm/commit/211f2d19fc5217b96d9c209fa6854203641ddc4c:
print()
method, return an object of new classreplay_html()
for that objectLooking forward to a "proper" solution still.
My use case is adding interactive webGL plots using knitr::hook_webgl()
.
I don't know if this can be done with repr as well.
@Bisaloo : I've made a number of improvements in the way rgl
works with knitr
recently. My next goal is to get it to work well in pkgdown
too.
I think this is now mostly handled by @dmurdoch's work (or at least will be when all the pieces come together, hopefully in the very near future).
Need to increase flexibility of output rendering so that documentation examples with htmlwidget output (#742) or gganimate objects (#935 and #941 ) render correctly.
Need to consider whether this should done with knitr (as in #941 and #742) or with repr (#959).
Would also be nice to be able to specify knitr options in examples.