Help us shape the future of Go! Take the 2026 Go Developer Survey

parse

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func File

func File(p string, data []byte) model.Doc

File parses one markdown file into a Doc. It never fails; malformed input becomes a warning on the returned Doc.

func SplitFrontmatter

func SplitFrontmatter(data []byte) (fm []byte, bodyStart, fmStart, fmEnd int, ok bool, warn string)

SplitFrontmatter locates a YAML frontmatter block delimited by --- fences. It returns the raw frontmatter bytes (between the fences), the byte offset where the body begins, the offsets of the whole block including both fences, whether a block was found, and any warning.

A UTF-8 BOM and CRLF are tolerated. An opening fence that never closes is a warning, and the function reports ok=false so the whole file is treated as body.

Types

This section is empty.

Jump to

Keyboard shortcuts

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