@enscribejs/interpreter
v0.1.0
Published
The enscribe interpreter: schema-driven dispatch from enscribeTag nodes to Layer 1 HTML, plus structural plugins (config discovery, article structuring, section nesting).
Maintainers
Readme
enscribe-interpreter
The enscribe interpreter. Takes an mdast tree containing enscribeTag
nodes (produced by remark-enscribe) and emits a self-contained Layer 1
HTML string.
enscribeInterpreter is a unified plugin. It registers a chain of mdast
transforms — discovery, structural transformation, numbering, ref / cite
resolution, note placement, bibliography — and a compiler that bridges
mdast to hast (via mdast-util-to-hast, with a custom enscribeTag
handler) and serializes to HTML. CSS, fonts, and conditional JavaScript
for hover previews are inlined into the output so documents render
correctly from file:// and offline.
Usage
import { unified } from 'unified';
import remarkParse from 'remark-parse';
import remarkEnscribe from '@enscribejs/remark';
import { enscribeInterpreter } from '@enscribejs/interpreter';
const result = await unified()
.use(remarkParse)
.use(remarkEnscribe)
.use(enscribeInterpreter)
.process(source);
console.log(String(result)); // HTML stringOptions: katexCss, hoverPreviewMode, assetsDir. See
notes/specs/interpreter.md §12 for details.
Documentation
STATUS.md— current project state.notes/specs/interpreter.md— interpreter architecture: plugin chain, handler dispatch, schema dispatch, asset injection, error handling.notes/specs/pipeline.md— pipeline stages, ordering, dependencies, data-flow examples.BACKLOG-ROADMAP.md— open work.
