
Get HTML File from improve Repository
getHTML.RdRetrieves HTML files (reports, widgets, interactive visualizations) from the improve repository and returns metadata including the local file path. The HTML file is downloaded and cached locally for embedding in RMarkdown reports or viewing in browsers.
Usage
getHTML(ident, from = pwd(), addAsLink = TRUE, caption = "")Arguments
- ident
Path, resource ID, or entity ID of the HTML file. Can be a relative path (from current step), absolute path, or improve identifier
- from
Root path for resolving relative paths. Defaults to
pwd()(current step location)- addAsLink
Logical. If
TRUE, creates a link in the inventory for provenance tracking. UseimproveClean()at workflow end to clean up links- caption
Custom caption text. If empty, defaults to entityID and lastModified timestamp
Value
A data frame with the following columns:
- caption
Character. Source information including entity version ID and last modified timestamp
- path
Character. Local file system path to the downloaded HTML file
- entityId
Character. Entity identifier on improve server
- name
Character. Filename of the HTML file
- description
Character. Description text (defaults to filename)
- resource
List. Complete resource metadata from improve server (29 fields)
Details
HTML files are cached locally in the HTML/ subdirectory of the current
working directory. Common use cases include embedding interactive reports,
htmlwidgets output (plotly, leaflet, DT tables), or standalone HTML
visualizations in RMarkdown documents.
Common workflows:
For RMarkdown embedding: Use
showHTML()to include HTML inlineFor browser viewing: Use the
pathcolumn to open HTML fileFor htmltools integration: Pass
pathtohtmltools::includeHTML()For metadata only: Access
entityId,name, etc.
See also
showHTML for RMarkdown embedding,
getData for loading data tables,
getGraphics for graphics files,
getR for R scripts
Examples
if (FALSE) { # \dontrun{
# Get HTML file metadata
report_info <- getHTML("results/interactive_plot.html")
report_path <- report_info$path
# Embed in RMarkdown using helper function
showHTML("results/interactive_plot.html")
# View in browser
html_info <- getHTML("reports/summary.html")
browseURL(html_info$path)
# Use with htmltools
widget_info <- getHTML("widgets/leaflet_map.html")
htmltools::includeHTML(widget_info$path)
} # }