Documentation
¶
Overview ¶
Ports packages/coding-agent/src/utils/frontmatter.ts.
Package frontmatter parses YAML frontmatter blocks from markdown files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Doc ¶
type Doc struct {
// Frontmatter holds the YAML values from the document header.
Frontmatter map[string]any
// Body is the trimmed markdown content following the closing `---`.
Body string
// Err reports malformed YAML. The body remains available to callers that
// intentionally tolerate malformed frontmatter.
Err error
}
Doc is a parsed markdown-with-frontmatter file.
func Parse ¶
Parse extracts and parses a YAML frontmatter block plus body. If the file does not begin with a closed frontmatter block, the whole input is returned as Body and Frontmatter is empty.
func (Doc) StringList ¶
StringList returns the named field as a []string, accepting either a list value or a single comma-separated string.
Click to show internal directories.
Click to hide internal directories.