| stubs_publish | R Documentation |
Copies framework stub templates to your project's stubs/ directory, allowing
you to customize them. Similar to Laravel's artisan vendor:publish command.
stubs_publish(type = "all", overwrite = FALSE, stubs = NULL)
type |
Character vector. Which stub types to publish:
|
overwrite |
Logical. Whether to overwrite existing stubs. Default FALSE. |
stubs |
Character vector. Specific stub names to publish (e.g., "default", "minimal"). If NULL (default), publishes all stubs of the specified type. |
Publish stubs to your project: stubs_publish()
Edit stubs in stubs/ directory to match your preferences
Use make_notebook() or make_script() - your custom stubs are used automatically
Stubs follow this naming pattern:
Notebooks: stubs/notebook-{name}.qmd or stubs/notebook-{name}.Rmd
Scripts: stubs/script-{name}.R
Framework searches user stubs first, then falls back to built-in stubs.
Stubs can use these placeholders:
{filename} - File name without extension
{date} - Current date (YYYY-MM-DD)
Invisible list of published file paths
make_notebook(), make_script(), stubs_list(), stubs_path()
if (FALSE) {
# Publish all stubs
stubs_publish()
# Publish only notebook stubs
stubs_publish("notebooks")
# Publish specific stub
stubs_publish(stubs = "default")
# Overwrite existing stubs
stubs_publish(overwrite = TRUE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.