Documentation
¶
Overview ¶
Package frontmatter parses simple metadata blocks from text files.
Index ¶
- func ArgumentList(value any) []string
- func Bool(value any) (bool, bool)
- func CompactStrings(values []string) []string
- func DescriptionFromMarkdown(body string) string
- func FirstString(values map[string]any, keys ...string) string
- func NormalizePaths(values []string) []string
- func Parse(text string) (string, map[string]any, error)
- func ScalarString(value any) string
- func String(values map[string]any, key string) string
- func StringList(value any) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArgumentList ¶
ArgumentList converts a frontmatter value into shell-like argument tokens.
func Bool ¶
Bool parses common frontmatter boolean representations and reports whether parsing was successful.
func CompactStrings ¶
CompactStrings trims values and removes empties and duplicates while preserving first-seen order.
func DescriptionFromMarkdown ¶
DescriptionFromMarkdown returns the first non-empty markdown line with leading heading markers removed.
func FirstString ¶
FirstString returns the first non-empty scalar string from keys.
func NormalizePaths ¶
NormalizePaths normalizes slash style, removes trailing glob suffixes, and compacts the result.
func Parse ¶
Parse extracts a leading YAML frontmatter block and returns the body and parsed values. Text without a complete frontmatter block is returned unchanged with nil values.
func ScalarString ¶
ScalarString converts a scalar frontmatter value to a string.
func StringList ¶
StringList converts strings or YAML lists into a compact list split on commas and newlines.
Types ¶
This section is empty.