metadata

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 14, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(m *Metadata) string

Format generates a standardized metadata block

func Update

func Update(content string, m *Metadata) string

Update replaces or adds metadata to content If metadata exists, it's replaced; otherwise it's prepended

Types

type Metadata

type Metadata struct {
	Title string
	Date  string
	Tags  []string
}

Metadata represents the structured metadata from a note file

func Extract

func Extract(content string) (*Metadata, error)

Extract is a convenience function for non-strict parsing

func ExtractStrict

func ExtractStrict(content string) (*Metadata, error)

ExtractStrict is a convenience function for strict parsing

type ParseError

type ParseError struct {
	Line    int
	Field   string
	Message string
}

ParseError represents a metadata parsing error

func (ParseError) Error

func (e ParseError) Error() string

type ParseResult

type ParseResult struct {
	Metadata *Metadata
	Errors   []ParseError
	Warnings []string
}

ParseResult contains the parsing outcome with detailed error information

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser handles metadata extraction from LaTeX files

func NewParser

func NewParser(strict bool) *Parser

NewParser creates a new metadata parser

func (*Parser) Parse

func (p *Parser) Parse(content string) (*ParseResult, error)

Parse extracts metadata from file content Returns metadata (possibly partial if not strict) and any errors/warnings

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL