extract

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package extract projects a schema-conformant Markdown document into a data tree whose shape mirrors the composed schema hierarchy. It runs after a successful schema match (extraction is gated on conformance) and never re-matches: it consumes the schema.MatchTree produced by schema.BuildMatchTree.

The default binding layer is intentionally annotation-free — see plan/166_schema-driven-data-extraction.md. Every emitted key flows through keyFor, the single seam a future custom-binding plan (plan 167) overrides.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Extract

func Extract(
	f *lint.File, sch *schema.Schema, m *schema.MatchTree,
) (any, []lint.Diagnostic)

Extract projects f against the composed schema sch using the pre-built match tree m. It returns the root data tree (a map[string]any) and any schema diagnostics raised during projection (sibling key collisions). On a collision the data tree is returned as-is up to the conflict; callers should treat a non-empty diagnostic slice as a hard failure and emit nothing.

Types

This section is empty.

Directories

Path Synopsis
Package encode serialises an extracted data tree into one of the supported wire formats.
Package encode serialises an extracted data tree into one of the supported wire formats.

Jump to

Keyboard shortcuts

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