Skip to contents

A short digest of structure_summary(), stored in generated slide decks so that check_slides_sync() can tell when a chapter's structure has moved. Deliberately insensitive to prose: editing a paragraph does not change the hash, but adding, removing, renaming or reordering a section does.

Usage

structure_hash(path)

Arguments

path

Path to a .qmd file.

Value

A single string: the first 12 characters of the hash.

Examples

chapter <- withr::local_tempfile(fileext = ".qmd")
writeLines(c("# Title", "", "Prose.", "", "## A section"), chapter)
structure_hash(chapter)
#> [1] "6721e1a46ae7"

# editing prose does not change the hash
writeLines(c("# Title", "", "Different prose.", "", "## A section"), chapter)
structure_hash(chapter)
#> [1] "6721e1a46ae7"