Install the library in your project from the command line:
npm i @digitallinguistics/scription2dlx
Option 1: Include the
scription2dlx library as a script in your HTML from the DLx CDN:
Option 2: Download the
scription2dlx.js file from the releases page and include it in a script tag in your HTML:
Option 3: Install
scription2dlx in your project using npm (see above), and then include the script in your HTML with a script tag. You may choose to use either the bundled distribution or the distribution that supports ES modules:
Both options will make a global
scription2dlx function available in the browser.
The library exports a single function,
scription2dlx, which accepts a String and returns a DaFoDiL Text Object.
--- title: How the world began --- waxdungu qasi one day a man
const data = await fetch(`data.txt`); const text = scription2dlx(data); console.log(text.title); // "How the world began"
Using as a Dependency
If you would like to use
scription2dlx as a dependency in your library, it is recommended that you use the files in the
/src folder. The source code for the