Skip to content

smelt.parse

Tier: Host — Available in every runtime, including headless mode.

Pure parsers: frontmatter extraction from markdown documents.

smelt.parse.frontmatter

fun(content: string): any, string

Split ----delimited YAML frontmatter from a markdown document. Returns (frontmatter_table, body) or (nil, content) when no frontmatter is present.

smelt.parse.json

fun(content: string): any

Parse a JSON document into a Lua value. Returns the decoded value on success, nil on parse error. Objects become tables, arrays become 1-indexed tables, numbers become integers when they fit losslessly.