Documentation
¶
Overview ¶
Package markdown parses and serializes inGitDB Markdown record files — YAML frontmatter delimited by "---" lines followed by a body. The body is preserved byte-for-byte across round-trips; the writer canonicalizes frontmatter key order to columns_order with alphabetical fallback for columns absent from columns_order, as required by the markdown-records feature spec.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
Parse splits a Markdown record into frontmatter and body.
When the file's first line is exactly "---" and a matching closing "---" appears on its own line later, the text between is parsed as a YAML mapping and returned as frontmatter; everything after the closing delimiter (including the newline that terminates the closing line) is returned as body, byte-for-byte.
When the file does not begin with "---", frontmatter is nil and the entire content is returned as body.
A leading "---" with no matching closing delimiter is a malformed frontmatter block and returns an error.
func Serialize ¶
Serialize emits a Markdown record: an opening "---" line, the frontmatter keys in canonical order (columns_order first, then alphabetical for any keys not in columns_order), a closing "---" line, and the body bytes verbatim.
When frontmatter is empty (or nil), the output still includes the two "---" lines so the file remains a valid frontmatter document.
Types ¶
This section is empty.