Documentation
¶
Index ¶
- Variables
- func ExtractFrontmatter(source []byte) (map[string]interface{}, error)
- func FrontmatterToJSON(fm map[string]interface{}) string
- func GetTags(fm map[string]interface{}) []string
- func GetTitle(fm map[string]interface{}) string
- func GetWikilinks(fm map[string]interface{}) []string
- func MetaGet(pc parser.Context) map[string]interface{}
- type ParseResult
- type RawLink
Constants ¶
This section is empty.
Variables ¶
View Source
var MetaExt goldmark.Extender = &metaExtension{}
MetaExt is a goldmark.Extender that parses YAML frontmatter.
Functions ¶
func ExtractFrontmatter ¶
ExtractFrontmatter extracts YAML frontmatter from markdown bytes using goldmark-meta. Returns nil, nil if no frontmatter is present.
func FrontmatterToJSON ¶
FrontmatterToJSON converts a frontmatter map to a JSON string. Returns "" if fm is nil.
func GetTags ¶
GetTags extracts the "tags" field from frontmatter, handling both []interface{} and []string.
func GetWikilinks ¶
GetWikilinks scans all string values in the frontmatter map for [[...]] patterns and returns the wikilink targets. Handles both string and slice values.
Types ¶
type ParseResult ¶
type ParseResult struct {
DocNode store.Node
Headings []store.Node
Defs []store.Node
Tags []store.Node // Deduplicated tag nodes
Edges []store.Edge
RawLinks []RawLink
FileInfo store.FileInfo
}
ParseResult contains all data extracted from a single markdown file.
type RawLink ¶
type RawLink struct {
Text string // Display text
Target string // Link target (path, wikilink name, URL)
Kind string // "wikilink", "markdown_link", "embed", "external"
Line int
FromNodeID string // ID of the containing node
}
RawLink represents a link found during parsing, before resolution.
Click to show internal directories.
Click to hide internal directories.