Documentation
¶
Overview ¶
Package frontmatter parses YAML-like frontmatter ("---" ... "---") from Markdown text. It is dependency-free and shared by command, memory, and skill packages — keeping a single implementation rather than three copies.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Normalize ¶
Normalize strips a leading UTF-8 BOM and replaces CRLF with LF, returning clean UTF-8 content suitable for parsing. Use on raw []byte before Parse.
func Parse ¶
Parse separates an optional leading "---"-fenced block of simple "key: value" lines from the body. Returns the parsed keys (lowercased, flattened from any depth) and the remaining body. With no opening/closing fence the whole input is the body; an unclosed opening fence is treated as body (conservatively: it's likely not frontmatter).
For large documents Parse avoids splitting the entire input: it scans for the closing fence with strings.Index, splits only the frontmatter region, and returns the body as a direct substring.
Types ¶
This section is empty.