EVOLUTION-MANAGER
Edit File: base64_uri.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Generate the Data URI for a file</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for base64_uri {xfun}"><tr><td>base64_uri {xfun}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Generate the Data URI for a file</h2> <h3>Description</h3> <p>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 <code>src</code> attribute of the <code style="white-space: pre;"><img /></code> tag. </p> <h3>Usage</h3> <pre> base64_uri(x) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>A file path.</p> </td></tr> </table> <h3>Value</h3> <p>A string of the form <code style="white-space: pre;">data:<media type>;base64,<data></code>. </p> <h3>Examples</h3> <pre> logo = xfun:::R_logo() img = htmltools::img(src = xfun::base64_uri(logo), alt = "R logo") if (interactive()) htmltools::browsable(img) </pre> <hr /><div style="text-align: center;">[Package <em>xfun</em> version 0.16 <a href="00Index.html">Index</a>]</div> </body></html>