Generate the Data URI for a file
Encode the file in the base64 encoding, and add the media type. The data URI
can be used to embed data in HTML documents, e.g., in the src
attribute of the <img />
tag.
base64_uri(x)
x |
A file path. |
A string of the form data:<media type>;base64,<data>
.
logo = xfun:::R_logo() img = htmltools::img(src = xfun::base64_uri(logo), alt = "R logo") if (interactive()) htmltools::browsable(img)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.