Skip to contents

Search templates by frontmatter field

Usage

lq_search(path, fields, source = NULL)

Arguments

path

Path to the library.

fields

Named character vector of frontmatter fields to match; results must match every field (AND).

source

Search only this source's templates.

Value

A lenguar_templates data frame with name, title, and source columns.

Examples

store <- withr::local_tempdir()
lq_init(store)
lq_add(store, "formal.md", "Dear Sir,", fields = c(tone = "formal"))
lq_search(store, c(tone = "formal"))
#> lengua: 1 template
#>        name title source
#> 1 formal.md  <NA>  local