Official repository for TEI Lex-0. It contains the Lex-0 ODD and build pipeline used to generate the schema and guidelines.
git clone https://github.com/BCDH/tei-lex-0.git
cd tei-lex-0
npm ci
XMLCALABASH_CMD=xmlcalabash npm run buildOpen build/html/index.html to view the generated documentation.
- Master ODD:
odd/lex-0.odd(includes and examples underodd/includes/andodd/examples/). - XProc pipeline:
xproc/lex-0.xpl. - XSLT stylesheets:
xslt/(used by the pipeline to generate schema and documentation). - Generated outputs:
build/(gitignored).- HTML docs:
build/html/(entry point:build/html/index.html) - Schemas:
build/html/schema/lex-0.rnglex-0.rnclex-0.xsd
- HTML docs:
- Node.js (for asset build scripts).
- XML Calabash (XProc 3.0) to run
xproc/lex-0.xpl.
npm run assets:odd runs scripts/run-xproc.mjs and looks for Calabash in this order:
XMLCALABASH_CMD(shell command string).xmlcalabashonPATH.calabashonPATH.XMLCALABASH_JARorCALABASH_JAR(full path to the Calabash jar).
Set one of these before running npm run assets:odd (or npm run build):
XMLCALABASH_CMD: a command string to run XML Calabash on your systemXMLCALABASH_JAR/CALABASH_JAR: full path to the Calabash jar file.
You can set the variable just for a single invocation by prefixing the npm command (this is one command, not two):
XMLCALABASH_CMD=xmlcalabash npm run assets:oddor
XMLCALABASH_JAR=/path/to/xmlcalabash-app-3.0.35.jar npm run assets:odd- Install dependencies:
npm ci(ornpm install) - Generate guidelines + schema (ODD → HTML + RNG):
npm run assets:odd - Generate only
CITATION.cfffrom the TEI header (fast, no full build):npm run citation:cff - Download/cached TEI upstream stylesheets locally (for catalog-based resolution in oXygen/offline):
npm run tei:resources - Full local build (recommended):
npm run build- Runs
assets:odd - Minifies CSS/JS into
build/html/css/andbuild/html/js/ - Copies images into
build/html/images/(referenced in the ODD and examples asimages/...)
- Runs
- Link hygiene for
build/html:npm run links:check - Release policy preflight (includes tag vs
odd/lex-0.oddedition check):npm run release:doctor -- --tag vX.Y.Z - Release metadata prep PR (to
dev):npm run release:prepare -- --tag vX.Y.Z - End-to-end release orchestration:
npm run release:cut -- --tag vX.Y.Z release:prepareandrelease:cutdefault to auto-confirm + non-interactive; use--interactiveif you want prompts.- Post-process HTML (banners/robots/minify):
npm run postprocess:html -- --mode=dev(or--mode=main)
The post-processor rewrites the already-generated static HTML under build/html/ (it does not regenerate HTML from the ODD).
It is implemented in scripts/postprocess-html.mjs and invoked via:
npm run postprocess:html -- --mode=<main|dev|release> [--sitemap=<main|dev|none>]npm run postprocess:html:dev(shorthand for--mode=dev --sitemap=dev)
What it does:
- Adds
robots.txt(mode-dependent). - Optionally generates
sitemap.xmlby walkingbuild/html/**/*.html:--mode=maindefaults to--sitemap=main(URLs underhttps://lex-0.org/...).--mode=devdefaults to--sitemap=dev(URLs underhttps://dev.lex-0.org/...).--mode=releasedefaults to--sitemap=none.
- For
devandrelease:- Adds
<meta name="robots" content="noindex,nofollow">(if missing). - Injects a fixed environment banner and a small CSS patch to keep the sticky sidebar/menu aligned.
- Adds
- For
release:- Adds
<link rel="canonical" href="https://lex-0.org/...">(if missing). - If
--release-status=historical(default), disables DocSearch (removes the loader/boot script and replaces the mount node with a static note).
- Adds
- Adds a build-info HTML comment (commit/tag/time) for debugging.
- Runs a conservative HTML minifier (skips pages containing
<pre>/<code>to avoid breaking code examples). - Strips previously injected environment artifacts so repeated runs don’t duplicate banners/comments.
For iterative work, run the watchers in separate terminals:
npm run assets:watchwatchesassets/,odd/, andxslt/and automatically re-runs the relevant build tasks:- CSS/JS changes →
assets:minify - Image changes →
assets:images - ODD/XSLT changes →
assets:odd - Outputs to
build/html/(andbuild/html/schema/)
- CSS/JS changes →
npm run postprocess:watchwatchesscripts/postprocess-html.mjsand re-runspostprocess:htmlin--mode=devwhen the postprocess script changes (useful when iterating on the postprocessor itself).
Stop either watcher with Ctrl+C.
Alternatively, you can build from inside oXygen XML Editor.
- Open the
lex-0.xprproject. - Run the transformation scenarios:
Lex-0: Generate Relax NG SchemaLex-0: Generate guidelines
- Install Node dependencies after cloning the repo for the first time with
npm ciin the root folder. - Build assets so HTML output has its CSS/JS by running
npm run assets:minifyin the cloned repo root folder.
You can run these transformations regardless of your currently open file. If you want toolbar buttons for even faster access to global transformations, see the OxyRuns plugin.
- Releases and day-to-day branch workflow: docs/git-workflow.md
- Deployment architecture (Vercel + GitHub Pages release archive): docs/deployment.md
- CITATION.cff generation and CI metadata injection: docs/cff.md
Release automation note: prefer the repo-local npm commands above (release:doctor,
release:prepare, release:cut) over machine-specific shell helpers.
TEI Lex-0 is maintained by the DARIAH Working Group on Lexical Resources.

