Documentation
¶
Overview ¶
Package frontmatter is abcd's shared markdown-frontmatter line scanner. It is deliberately a line scanner, not a YAML parser: it reads only the top-level keys of the leading `---`…`---` block, first key wins, and pulls in zero dependencies. It exists so its consumers (internal/core/spec, internal/core/intent, and record-lint's top-level frontmatter checks) share ONE copy of this primitive rather than each keeping a private replica.
It is transport-agnostic: no stdout, no os.Exit, no filesystem access — the caller supplies the file's lines and decides what the fields mean.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Fields ¶
Fields returns the top-level keys of the leading frontmatter block (the block between the first two `---` lines). Nested keys and list items are ignored, and the first occurrence of a key wins. An input whose first line is not `---` (or is empty) yields no fields. An unclosed block — a leading `---` with no closing `---` — is treated as no frontmatter (an empty map), so body prose is never harvested as fields.
func TrimBOM ¶
TrimBOM removes a single leading UTF-8 byte-order mark from s. The mark only ever appears as the file's very first bytes, so callers apply this to the first line before testing it for the opening `---`: a BOM sits invisibly ahead of the delimiter and, untrimmed, makes a well-formed record read as having no frontmatter — every frontmatter-keyed gate then passes it silently.