frontmatter

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package frontmatter detects and extracts YAML frontmatter from markdown sources and renders it as an HTML table.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Extract

func Extract(src []byte) (fm []byte, body []byte, found bool)

Extract splits src into (frontmatterBytes, bodyBytes, found).

found is true only when:

  • src starts with exactly "---\n" or "---\r\n" at byte offset 0
  • a closing "---" appears on its own line before EOF
  • the bytes between the delimiters parse as valid YAML

When found is false, bodyBytes == src (full content unchanged, no copy). When found is true, bodyBytes is the content after the closing delimiter line.

func RenderTable

func RenderTable(fm []byte) ([]byte, error)

RenderTable renders parsed YAML frontmatter bytes as an HTML table. Top-level keys appear in document order. Nested values are rendered as their string representation. All values are HTML-escaped.

Types

This section is empty.

Jump to

Keyboard shortcuts

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