Documentation
¶
Overview ¶
package meta is a extension for the goldmark that's vendored in xlog.
This extension parses YAML metadata blocks and store metadata to a parser.Context.
Index ¶
- Variables
- func Get(pc parser.Context) map[string]any
- func GetItems(pc parser.Context) yaml.MapSlice
- func MetaProperties(p xlog.Page) []xlog.Property
- func New(opts ...Option) markdown.Extender
- func NewParser() parser.BlockParser
- func TryGet(pc parser.Context) (map[string]any, error)
- func TryGetItems(pc parser.Context) (yaml.MapSlice, error)
- type Frontmatter
- type MetaProperty
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var Meta = &meta{}
Meta is a extension for the markdown.
Functions ¶
func GetItems ¶ added in v1.7.10
GetItems returns a YAML metadata. GetItems preserves defined key order.
func MetaProperties ¶
MetaProperties extracts frontmatter metadata from a page and returns them as properties that can be displayed in the page view.
func NewParser ¶ added in v1.7.10
func NewParser() parser.BlockParser
NewParser returns a BlockParser that can parse YAML metadata blocks.
Types ¶
type Frontmatter ¶
type Frontmatter struct{}
func (Frontmatter) Init ¶
func (Frontmatter) Init()
func (Frontmatter) Name ¶
func (Frontmatter) Name() string
type MetaProperty ¶
func (MetaProperty) Icon ¶
func (m MetaProperty) Icon() string
func (MetaProperty) Name ¶
func (m MetaProperty) Name() string
func (MetaProperty) Value ¶
func (m MetaProperty) Value() any
type Option ¶ added in v1.7.10
type Option interface {
// contains filtered or unexported methods
}
Option interface sets options for this extension.
func WithStoresInDocument ¶ added in v1.7.10
func WithStoresInDocument() Option
WithStoresInDocument is a functional option that parser will store YAML meta in ast.Document.Meta().
Click to show internal directories.
Click to hide internal directories.