@leiden-js/transformer-leiden-trans
v1.0.5
Published
Transform Leiden Translation to EpiDoc XML and vice-versa
Readme
@leiden-js/transformer-leiden-trans
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 Translation notation and EpiDoc XML.
Installation
npm install @leiden-js/transformer-leiden-transUsage
Leiden Translation to XML
import { leidenTransToXml } from "@leiden-js/transformer-leiden-trans";
const translationText = "<T=.en <D=.n <= ((1)) example 〚translation〛 => =D>";
const xml = leidenTransToXml(translationText);XML to Leiden Translation
import { xmlToLeidenTrans } from "@leiden-js/transformer-leiden-trans";
const xml = `
<div xml:lang="en" type="translation" xml:space="preserve">
<div n="n" type="textpart">
<p> <milestone unit="line" n="1"/> example <del>translation</del></p>
</div>
</div>`;
const leiden = xmlToLeidenTrans(xml);Features
- Bidirectional transformation between Leiden Translation and XML
- Support for translation-specific markup patterns
- Configurable document structure
- Error handling and validation
Related Packages
@leiden-js/parser-leiden-trans- Required parser for Leiden Translation input@leiden-js/transformation-service- REST API using these transformers
