View source: R/init_template.R
init_template | R Documentation |
Create a new initializer function, and a spec file against which initialized templates can be checked.
init_template(name, files, dir = ".", spec_dir = ".", context = name,
overwrite = FALSE)
name |
Name of the template to be checked. |
files |
List of paths to required files, relative to dir.
|
dir |
Package directory. |
spec_dir |
Parent directory of the |
context |
name of the template's context: itself, or another templated structure. |
overwrite |
logical; if |
Creates a name.json file (in dir/inst/specs
if it exists, or the current working directory),
and invisibly returns its path.
## Not run:
# creates a version of the function spec.
init_template("function", list("R/{name}.R", "tests/testthat/text-{name}.R"))
# creates a version of the shiny function, showing alternative sets
init_template("shiny", list(
list(
c("ui.R", "server.R"),
"app.R"
),
"README.md"
), spec_dir = "app")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.