generate_pkg | R Documentation |
HTTP API package generator
generate_pkg(
pkg_path,
template_path = NULL,
http_lib = "crul",
base_url = NULL
)
pkg_path |
(character) Path to the new package, where last part will be the package name |
template_path |
(character) path to your yaml template file. by default, we use a demo template yaml file |
http_lib |
(character) one of |
base_url |
(character) Base URL. If |
## Not run:
generate_pkg(pkg_path = "mypkg")
# from a Swagger spec
url <- "https://raw.githubusercontent.com/ropenscilabs/apispecs/master/swagger/crossref.yml"
# x <- paste0(readLines(url), collapse = "\n")
# yaml::yaml.load(string = x)
download.file(url, "crossref.yml")
my_dir <- file.path(tempdir(), "apples")
generate_pkg(pkg_path = my_dir, template_path = "crossref.yml")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.