Skip to contents

Strips the YAML frontmatter block and any leading blank lines, returning only the document content. Used by build_llms_docs() to assemble rendered page content into llms-full.txt. Returns NULL for missing files so the caller can decide whether to fail or skip.

Usage

parse_quarto_body(path)

Arguments

path

Path to a .qmd, .md, or .llms.md file. Returns NULL (rather than erroring) when the file does not exist, because this function is called in loops over rendered output where some files may legitimately not exist during incremental builds.

Value

A character string of the document body with frontmatter and leading whitespace removed, or NULL if the file does not exist.

See also

Other extraction: parse_quarto_yaml()

Examples

path <- tempfile(fileext = ".md")
writeLines(c(
  "---",
  "title: Example",
  "---",
  "",
  "First paragraph.",
  "Second paragraph."
), path)
parse_quarto_body(path)
#> [1] "First paragraph.\nSecond paragraph."