This repository provides a local, Docker-based preview for one Library of Digital Latin Texts (LDLT) edition at a time. It validates the edition's TEI citation structures, transforms the TEI into Jekyll pages using Saxon and publish.xsl, and serves the resulting site with Jekyll and CETEIcean.
The edition's source XML remains in its own repository. The preview application reads it through a temporary, read-only Docker mount; editors do not need to copy the XML into this repository or edit Docker configuration to select an edition.
- Docker Desktop (or Docker Engine with Docker Compose v2)
- A local copy of this repository
- The TEI XML file for the edition to preview
Ruby, Jekyll, Java, and Saxon run inside Docker; they do not need to be installed on the host.
From the root of this repository, build the preview image:
docker compose buildMake the helper script executable if necessary:
chmod +x preview.shIf the image is new and Ruby dependencies have not yet been installed in the Docker volume, run:
docker compose run --rm --no-deps preview bundle installThe bundle_cache Docker volume retains the installed gems between runs. If you see bundler: command not found: jekyll, run the bundle install command above inside Docker (not on your Mac).
./preview.sh build /absolute/path/to/edition.xml EDITION_SLUGFor example:
./preview.sh build /Users/huskey/Development/test_repo/cutedition.xml mutchThe XML path identifies the authoritative TEI file. The slug identifies the edition's URL; it does not have to match the XML filename. In the example, the edition is served at /editions/mutch, not /editions/cutedition.
During a build, preview.sh:
- Checks that the XML file exists.
- Creates a temporary Docker Compose override that mounts the XML read-only at the path expected by the build script.
- Runs
build-preview.shinside Docker. - Validates
<citeStructure>and related citation expressions usingxslt/validate-citestructure.xsl. - Stops the build on validation errors; warnings are reported but do not stop publication.
- Runs
xslt/publish.xsl, passing the edition slug, and builds the Jekyll site. - Deletes the temporary Compose override.
A successful build produces the pages that the preview server serves. A failed validation prevents the transformation and Jekyll build from running.
Start the server:
./preview.sh serveOpen http://localhost:4000 in your browser. For the example above, the edition page is http://localhost:4000/editions/mutch.
The server does not require the XML path: it serves the files generated by the last successful build.
Stop the server:
./preview.sh stopCheck container status or follow logs:
./preview.sh status
./preview.sh logslogs follows the server output; press Ctrl+C to stop following logs without stopping the server.
| Command | Purpose |
|---|---|
./preview.sh build XML_PATH EDITION_SLUG |
Validate and transform the TEI, then build the Jekyll site. |
./preview.sh serve |
Start the Jekyll preview server. |
./preview.sh stop |
Stop the preview server. |
./preview.sh status |
Show Docker Compose container status. |
./preview.sh logs |
Follow recent preview server logs. |
./preview.sh help |
Display command usage. |
The build and server are separate operations. Ordinarily, run build after changing the TEI source, then use serve to view the result. If the server is already running, consult its logs to confirm that it has regenerated the site; restart or recreate it if necessary.
The preview container mounts this repository into /site. The Jekyll server has been configured with watching and forced polling, so changes to Jekyll source files should trigger a rebuild automatically:
bundle exec jekyll serve \
--host 0.0.0.0 \
--port 4000 \
--watch \
--force_pollingThat command is part of the Docker Compose service configuration; you do not need to run it on the host.
For changes to _layouts/, _includes/, CSS, or JavaScript, save the file and refresh your browser. There is normally no need to rerun the TEI transformation. If you change the TEI XML or the XSLT responsible for generating edition pages, run ./preview.sh build ... again.
To inspect Jekyll's file-watching activity:
./preview.sh logsImportant: Editing compose.yaml does not update an already running container. To apply changes to the service command or mounts, recreate the container:
docker compose up -d --no-build --force-recreate previewA simple docker compose restart does not apply changes to the Compose configuration.
- One edition at a time: this is an editorial preview, not a multi-edition publishing portal.
- No edition-specific
.envor Compose configuration:preview.sh buildreceives the XML path and slug directly. - Read-only source: the build mounts the authoritative TEI XML read-only; generated preview files live in this repository's Jekyll workspace.
- Stable URLs: the slug passed to the build should be used for generated edition URLs, regardless of the source filename.
- Presentation vs. transformation: Jekyll layouts, includes, and styles control the interface; XSLT handles TEI validation and publication.
- Dockerized dependencies: Saxon, Ruby/Bundler, and Jekyll run in the container.
bundler: command not found: jekyll
Install the bundle inside the Docker environment:
docker compose run --rm --no-deps preview bundle installChanges to layouts or styles do not appear
Check ./preview.sh logs for Jekyll rebuild messages. Confirm that the running container was recreated after enabling --watch --force_polling:
docker compose up -d --no-build --force-recreate previewThe edition link returns 404
Confirm that the URL uses the edition slug, not the XML filename. Rebuild after modifying the slug or the relevant publish.xsl URL-generation logic.
Validation fails
Read the validator's reported errors and warnings. Errors stop publication; warnings do not. The additional Saxon XTMM9000 termination message is expected when the validator deliberately ends the transformation after reporting errors.
Docker Compose reports a missing EDITION_XML variable
The current design does not require EDITION_XML in compose.yaml. Remove any old ${EDITION_XML:?...} volume declaration; the build script supplies the XML mount through a temporary Compose override.
| File or directory | Role |
|---|---|
preview.sh |
Editor-facing command-line interface. |
compose.yaml |
Docker preview service and persistent Bundler volume. |
Dockerfile.preview |
Container runtime with Ruby, Java, and Saxon. |
build-preview.sh |
Validation, transformation, and Jekyll build pipeline. |
xslt/validate-citestructure.xsl |
Citation-structure validation and diagnostics. |
xslt/publish.xsl |
TEI-to-Jekyll publication transformation. |
_layouts/, _includes/ |
Jekyll page structure and navigation. |
assets/ |
Stylesheets and client-side TEI/apparatus functionality. |