Skip to contents

Ensures a .qmd file has the metadata required for llms.txt generation: a non-empty title and description. Also validates the full frontmatter against the bundled JSON Schema for structural correctness. Use this to check individual files before running a project-wide validation.

Usage

check_quarto_yaml(path)

Arguments

path

Path to a .qmd document. Must point to an existing file because validation of a nonexistent file is always an error, never something to silently skip.

Value

TRUE invisibly if valid. Calls cli::cli_abort() on any failure with the file path and specific field that failed.

Examples

path <- tempfile(fileext = ".qmd")
writeLines(c(
  "---",
  "title: Install Guide",
  "description: Step-by-step installation instructions.",
  "---",
  "",
  "Content."
), path)
check_quarto_yaml(path) # TRUE