Skip to content

cforney/odd-rendering-compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ODD Rendering Compiler

Companion code for the Code4Lib Journal article The TEI ODD as Static-Build Configuration: Compiling the Processing Model into Edition Rendering (Christian Forney, 2026).

A TEI ODD's Processing Model already says how each element should be presented. This project treats that declaration as build-time configuration: a compiler reads the ODD and generates the rendering artefacts — CSS, an XSLT stylesheet, unified/xast handlers, CETEIcean behaviours — which then render a TEI document into static HTML. No server, no runtime ODD interpreter; just a clean clone that builds.

Define → generate → render. The ODD is the single source of truth (define); a build tool compiles its behaviours into rendering artefacts (generate); those artefacts turn TEI into a static edition (render).

The chain is implemented twice — in JavaScript and in XSLT — on purpose: the generate step is generic, not tied to one language, and the two implementations produce an equivalent static body. That equivalence is itself part of the article's argument.

Note. This is an experimental implementation: it exists to illustrate the idea and reproduce the article, not as production code.

What's here

Directory What it is
compiler-js/ JavaScript reference implementation (generators, renderers, shared ODD parser, smoke tests)
compiler-xslt/ XSLT reference implementation (the same chain, built entirely in XSLT + Saxon)
examples/ Shared inputs for both compilers — the real Simler edition and the TEI's simplePrint exemplar — with provenance and credits

Quick start — JavaScript

Requires Node.js ≥ 20.

cd compiler-js
npm install
npm run demo    # compile the Simler ODD, then render → static + interactive HTML
npm test        # end-to-end smoke tests

Generated artefacts and rendered pages land in compiler-js/output/. See compiler-js/README.md for every generator and renderer.

Quick start — XSLT

Requires Java and Saxon HE 12. Point SAXON_HOME at your unpacked Saxon HE 12 directory (download it from https://www.saxonica.com/download/java.xml), then:

cd compiler-xslt
bash build.sh     # default: the Simler edition
# or, on Windows:
./build.ps1

Outputs land in compiler-xslt/output/. With Node present the build also emits a client-side SaxonJS demo (rendered-saxonjs.html): the same edition.xsl, compiled to a SEF and run in the browser with IXSL toggles — serve it over HTTP (e.g. npx http-server compiler-xslt/output). See compiler-xslt/README.md for details.

Examples, licensing, and credits

  • The code is licensed BSD-2-Clause (see LICENSE).
  • The example texts in examples/ are not covered by it — they keep their originating projects' terms and are included only as illustration. See examples/README.md for provenance and credits (Simler Digital / e-rara, CC BY-SA; the TEI Consortium's simplePrint exemplar).

How to cite

See CITATION.cff.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors