Takes the same adoption arguments as lq_init(), but requires path to
already be a library and appends rather than replaces — this is how a
project pools templates from more than one existing store. The new
source becomes the highest-precedence one for merged reads: if it
defines a template name that another source already has, that name now
resolves to the new source (see lq_get()/lq_list()/lq_search()),
and the returned result's warnings names any such collision.
Usage
lq_fetch(
path,
name = NULL,
from_dir = NULL,
from_repo = NULL,
ref = NULL,
subdir = NULL,
force = FALSE
)Arguments
- path
Path to the library (as created by
lq_init()).- name
Name for the new source. Auto-derived from
from_dir's basename orfrom_repo's last path segment if omitted — errors asking for an explicitnameon a collision, rather than silently picking a different one.- from_dir, from_repo, ref, subdir, force
See
lq_init().
Value
Invisibly, a lenguar_fetch_result (has $source and
$warnings, a character vector, possibly empty).
Examples
store <- withr::local_tempdir()
lq_init(store)
other <- withr::local_tempdir()
lq_init(other)
lq_fetch(store, from_dir = other, name = "other")