Core AST definitions, parsing infrastructure, and format-agnostic renderers for the LexBuild ecosystem.
Package Exports
@lexbuild/core
Readme
@lexbuild/core
Shared infrastructure for the LexBuild legal-XML-to-Markdown pipeline. Provides streaming XML parsing, AST definitions, Markdown rendering, YAML frontmatter generation, and cross-reference link resolution used by all source packages.
Streaming SAX parser wrapping saxes with namespace normalization. Supports USLM (namespaced) and namespace-free XML (eCFR) via the defaultNamespace option.
AST Builder
Export
Description
ASTBuilder
Stack-based USLM XML-to-AST builder with configurable emit-at-level streaming. Handles the full USLM 1.0 element vocabulary. Source packages for other formats provide their own builders.
Rendering
Export
Description
renderDocument()
Render a section node with frontmatter to a complete Markdown file
renderSection()
Render a section-level node to Markdown body text
renderNode()
Render any AST node to Markdown
generateFrontmatter()
Generate a YAML frontmatter block from FrontmatterData
createLinkResolver()
Create a cross-reference link resolver supporting USC, CFR, and fallback URLs
packages/
├── core/ ← you are here
├── usc/ # depends on core
├── ecfr/ # depends on core
├── fr/ # depends on core
└── cli/ # depends on core, usc, ecfr, fr