@enscribejs/enscribe
v0.4.0
Published
Academic publishing on HTML+CSS+JS, with a shorthand authoring syntax. The headline library: the Layer 1 core foundation, the shorthand parser (remark plugin), and the interpreter that compiles enscribeTag nodes to Layer 1 HTML.
Maintainers
Readme
enscribe
The headline Enscribe library: the Layer 1 core foundation, the shorthand
parser (a remark plugin), and the interpreter that compiles enscribeTag
mdast nodes into a self-contained Layer 1 HTML string. (Formerly published as
three packages — @enscribejs/core, @enscribejs/remark, and
@enscribejs/interpreter — now consolidated here.)
Entry points
@enscribejs/enscribe— the interpreter entry (enscribeInterpreter,buildEnscribePipeline, the structural plugins,liftToCanonicalMdast, …). This is the main entry (".").@enscribejs/enscribe/parser— the shorthand parser (the default-exported remark plugin);@enscribejs/enscribe/parser/recursive-contentis the recursive-content transform.@enscribejs/enscribe/core/*— the inward-pointing shared foundation (tag factories, registries, walkers, attribute mapping), available as per-module subpaths (e.g.@enscribejs/enscribe/core/tag,@enscribejs/enscribe/core/map-attributes).@enscribejs/enscribe/browser— the browser façade bundle (render/renderInto/executeAssets), built bynpm run build:lib.@enscribejs/enscribe/default.css— the Layer 1 display stylesheet (for browser viewing; it is not emitted by the interpreter).
Usage (Node)
import { unified } from 'unified';
import remarkParse from 'remark-parse';
import remarkEnscribe from '@enscribejs/enscribe/parser';
import { enscribeInterpreter } from '@enscribejs/enscribe';
const result = await unified()
.use(remarkParse)
.use(remarkEnscribe)
.use(enscribeInterpreter)
.process(source);
console.log(String(result)); // HTML stringOr the one-call helper:
import { buildEnscribePipeline } from '@enscribejs/enscribe';
const html = String(buildEnscribePipeline({ embedResources: true }).processSync(source));Options: katexCss, hoverPreviewMode, assetsDir, embedResources,
dslMode, toc, theme. See
notes/specs/interpreter.md §12 for details.
Layout
src/core/— the shared foundation (was@enscribejs/core).src/parser/— the shorthand parser; the Peggy grammar lives ingrammar/enscribe.peggy, compiled tosrc/parser/generated/parser.jsbybuild/compile-grammar.js(was@enscribejs/remark).src/interpreter/— the mdast → HTML interpreter and its bundled assets (was@enscribejs/interpreter).
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.- Open work — GitHub Issues;
ROADMAP.md— the phase plan and release targets.
