Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
G

goldmark-meta

> 编程语言
Open source

A YAML metadata extension for the goldmark markdown parser.

99 stars0 likes0 views
WebsiteGitHub

About

A YAML metadata extension for the goldmark markdown parser.

goldmark-meta

GoDev

goldmark-meta is an extension for the goldmark that allows you to define document metadata in YAML format.

Usage

Compatiblity

goldmark-meta/v2 is compatible with goldmark/v2.

Installation

go get github.com/yuin/goldmark-meta/v2

Markdown syntax

YAML metadata block is a leaf block that can not have any markdown element as a child.

YAML metadata must start with a YAML metadata separator. This separator must be at first line of the document.

A YAML metadata separator is a line that only ---.

YAML metadata must end with a YAML metadata separator.

You can define objects as a 1st level item. At deeper level, you can define any kind of YAML element.

Example:

---
Title: goldmark-meta
Summary: Add YAML metadata to the document
Tags:
    - markdown
    - goldmark
---

# Heading 1

Access the metadata

go
import (
    "fmt"
    "github.com/yuin/goldmark/v2/parser"
    "github.com/yuin/goldmark/v2/ast"
    "github.com/yuin/goldmark-meta/v2"
)

func main() {
	source := []byte(`---
Title: goldmark-meta
Summary: Add YAML metadata to the document
Tags:
    - markdown
    - goldmark
---
`)

	document := parser.New(
		parser.WithExtensions(
			meta.Parser,
		),
	).Parse(source)
	metaData := document.(*ast.Document).Metadata()
	title := metaData["Title"]
	fmt.Print(title)
}

Render the metadata as a table

Use meta.WithTable() on the HTML renderer extension:

…

License

MIT

Author

Yusuke Inuzuka

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Go

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言