metadata

package
v0.0.0-...-6f7621a Latest Latest
Warning

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

Go to latest
Published: May 14, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package metadata provides functionality for generating, parsing and operating on Front Matter metadata within Markdown files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate() string

Generate returns a string repesentation of the Front Matter metadata block to be included within a new note file.

Types

type Fields

type Fields struct {
	ID      string `yaml:"id"`
	Created string `yaml:"created"`
}

Fields are the different values within the Front Matter block at the top of any note.

func Parse

func Parse(cfg config.Config, filename string) (Fields, error)

Parse decodes the values within the Front Matter block at the top of the note at the given filepath, and returns them as a metadata.Fields type.

func (Fields) Validate

func (f Fields) Validate() error

Validate checks that the values within the Front Matter metadata block valid.

Jump to

Keyboard shortcuts

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