@leiden-js/parser-leiden-plus
v1.0.5
Published
A Lezer based parser for Leiden+
Readme
@leiden-js/parser-leiden-plus
Part of leiden-js, a set of packages for working with the Leiden notation systems used in epigraphic digital editing within JavaScript environments.
Lezer-based parser for Leiden+ notation, generating syntax trees for the Leiden+ epigraphic notation system.
Installation
npm install @leiden-js/parser-leiden-plusUsage
import { parser } from "@leiden-js/parser-leiden-plus";
const text = "1. example [text]";
const tree = parser.parse(text);
// With custom top node
const tree = parser.configure({ top: "InlineContent" }).parse(text);
console.log(tree.toString());Top Node Options
The parser supports different entry points:
Document(default) - Complete document structureBlockContent- Block-level content onlyInlineContent- Inline content onlySingleAb- Single paragraphSingleDiv- Single division
Related Packages
@leiden-js/codemirror-lang-leiden-plus- CodeMirror language integration@leiden-js/linter-leiden-plus- Linting for syntax trees produces by this parser@leiden-js/transformer-leiden-plus- Transformations using this parser
