@leiden-js/transformer-leiden-plus
v1.0.5
Published
Transform Leiden+ to EpiDoc XML and vice-versa
Downloads
2
Readme
@leiden-js/transformer-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.
Bidirectional transformer for converting between Leiden+ notation and EpiDoc XML.
Installation
npm install @leiden-js/transformer-leiden-plusUsage
Leiden+ to XML
import {leidenPlusToXml} from "@leiden-js/transformer-leiden-plus";
const leidenText = "<S=.grc <D=.r <= 1. Ἰωάννης, (υ(ἱὸς)) Ἀντωνίου => =D>";
const xml = leidenPlusToXml(leidenText);XML to Leiden+
import {xmlToLeidenPlus} from "@leiden-js/transformer-leiden-plus";
const xml = `
<div xml:lang="grc" type="edition" xml:space="preserve">
<div n="r" type="textpart">
<ab> <lb n="1"/>Ἰωάννης, <expan>υ<ex>ἱὸς</ex></expan> Ἀντωνίου</ab>
</div>
</div>`;
const leiden = xmlToLeidenPlus(xml);Related Packages
@leiden-js/parser-leiden-plus- Parser for Leiden+ input@leiden-js/transformation-service- REST API using his transformer
