Open bwlewis opened 9 years ago
In D3TableFilter (https://github.com/ThomasSiegmund/D3TableFilter) I need to include some icons. Attaching them like this (from D3TableFilter/inst/htmlwidgets/D3TableFilter.yaml)
attachment:
- TF_Themes/blank.png
- TF_Themes/bg_mod_cell.png
- TF_Themes/btn_clear_filters.png
works fine for everything but for self-contained html documents generated with htmlwidgets::savewidget due to the problem described above. Is there a known workaround?
Thanks
Thomas
@ThomasSiegmund the workaround is to replace such images by their dataURIs. @bwlewis has used it successfully in his rthreejs
package.
This is not a bug, just something to note (that maybe should eventually be documented somewhere).
The yaml dependency syntax technically supports including any kind of file in the widget; including things like supporting image files can sometimes be useful. But that flexibility is not compatible with pandoc/rmarkdown. For example, including jpeg files specified as yaml attachments like this (from a version of the threejs package):
ends up producing errors in rmarkdown like this:
See the threejs bug here https://github.com/bwlewis/rthreejs/issues/5
My advice is to not include binary files like images in yaml-specified dependencies, even though this is technically possible. Use dataURI encoding instead to supply images to your documents.