Skip to contents

Flattens the structural blocks of a .qmd into a character vector suitable for hashing. Two documents with the same headings and the same code produce the same summary regardless of their prose.

Usage

structure_summary(path)

Arguments

path

Path to a .qmd file.

Value

A character vector, one element per structural block.

Examples

chapter <- withr::local_tempfile(fileext = ".qmd")
writeLines(c("# Title", "", "Prose here.", "", "## A section"), chapter)
structure_summary(chapter)
#> [1] "h1:Title"     "h2:A section"