Skip to main content

Module frontmatter

Module frontmatter 

Source

Structs§

Frontmatter
The fields Sloop understands in a committed Markdown file. Unknown keys are preserved on disk and simply ignored here.

Enums§

FrontmatterError

Functions§

body
Returns the Markdown body after the leading frontmatter block.
parse
Parses the leading --- frontmatter block. A file without a block parses to an empty Frontmatter; a malformed block is an error so a typo never silently registers a ticket under the wrong identity.
parse_collecting
Parses the block, accumulating field-level problems rather than stopping at the first one.
stamp
Writes id, project, worktree, and flow into the frontmatter without disturbing any other byte of the file. Returns None when the file already carries all four values, so callers can skip the write entirely.
stamp_id
Writes only id, for project files. Existing IDs return None so startup can leave an already identified project byte-for-byte untouched.