utility to view rendered .html file stored in a github repo
Source:R/URL_FUNCTIONS_part2.R
url_github_preview.Rdutility to view rendered .html file stored in a github repo
Usage
url_github_preview(
ghurl = NULL,
repo = EJAM::url_package("code", get_full_url = TRUE),
ver = "main",
fold = "inst/testdata/examples_of_output",
file = "testoutput_ejam2report_10pts_1miles.html",
launch_browser = TRUE
)Arguments
- ghurl
URL of HTML (or other type) file in a github repository, inferred by default from parameters repo, ver, fold, and file
- repo
URL of github repository, optional
- ver
name of branch or tag of a released version, like "main" or "development" or "v2.32.8.001"
- fold
path to the repository subfolder containing the HTML file, relative to the selected branch or tag, such as
"docs/reference"or"inst/testdata/examples_of_output"or"inst/app/www"- file
name of the HTML file within
fold, such as"index.html"or"ejam2excel.html"- launch_browser
set FALSE to get URL but not launch a browser
Examples
url_github_preview(fold = "docs",
launch_browser = FALSE, file = "index.html")
url_github_preview(fold = "docs/reference",
launch_browser = FALSE, file = "ejam2excel.html")
if (FALSE) { # \dontrun{
# Compare versions of the HTML summary report:
myfile = "testoutput_ejam2report_100pts_1miles.html"
# in latest main branch on GH (but map does not render using this tool)
url_github_preview(file = myfile)
# from a specific release on GH (but map does not render using this tool)
vernum = paste0("v", desc::desc_get(
"Version", file = system.file("DESCRIPTION", package="EJAM")))
url_github_preview(ver = vernum, fold = "inst/testdata/examples_of_output", file = myfile)
# local installed version
browseURL(testdata(myfile, quiet = TRUE))
browseURL( system.file(file.path("testdata/examples_of_output", myfile), package="EJAM") )
# local source package version in checked out branch
browseURL(testdata(myfile, quiet = TRUE, installed = FALSE))
browseURL( file.path(testdatafolder(installed = FALSE), "examples_of_output", myfile) )
} # }