@glyphjs/compiler
v0.6.0
Published
Compiles Glyph AST into IR with schema validation and diagnostics
Maintainers
Readme
@glyphjs/compiler
Compiles Glyph markdown into a validated IR (Intermediate Representation) with schema validation and diagnostics.
Install
pnpm add @glyphjs/compilerUsage
import { compile } from '@glyphjs/compiler';
const markdown = `
# My Document
\`\`\`ui:graph
nodes:
- id: a
label: Start
edges:
- from: a
to: b
\`\`\`
`;
const result = compile(markdown);
// result.ir -- the compiled GlyphIR document
// result.diagnostics -- any warnings or errorsAPI
compile(markdown, options?)-- end-to-end markdown-to-IR compilationtranslateNode(node, context)-- convert a single AST node to IR blocksextractAllInlineReferences(ir)-- extract cross-block referencescompileContainerBlocks(blocks)-- compile nested container structurescreateDiagnostic(...)-- helper for building diagnostic objects
Docs
https://github.com/VledicFranco/glyphjs
