Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Document ¶
type Document struct {
// HasFrontMatter indicates whether front matter was found.
HasFrontMatter bool
// RawFrontMatter is the raw YAML text between the --- delimiters.
RawFrontMatter string
// Body is the Markdown content after the front matter.
Body string
// Node is the parsed yaml.Node tree (for minimal-change editing).
Node *yaml.Node
// OriginalContent is the original full file content.
OriginalContent string
}
Document represents a parsed Markdown file with optional YAML front matter.
func Parse ¶
Parse splits a Markdown document into front matter and body. If the file doesn't start with ---, HasFrontMatter is false and Body is the full content. If it starts with --- but YAML is invalid, returns an error.
func ParseAndValidate ¶
ParseAndValidate combines Parse and Validate.
func (*Document) Get ¶
func (d *Document) Get(path pathsyntax.Path) *yaml.Node
Get retrieves the yaml.Node at the given path. Returns nil if not found or if there is no front matter.
func (*Document) GetValue ¶
func (d *Document) GetValue(path pathsyntax.Path) interface{}
GetValue retrieves the Go value at the given path. Returns nil if path not found.
Click to show internal directories.
Click to hide internal directories.