diff options
| -rw-r--r-- | .forgejo/workflows/build-epubs.yml | 6 | ||||
| -rw-r--r-- | README.md | 13 |
2 files changed, 18 insertions, 1 deletions
diff --git a/.forgejo/workflows/build-epubs.yml b/.forgejo/workflows/build-epubs.yml index 80ecf5d..e18556f 100644 --- a/.forgejo/workflows/build-epubs.yml +++ b/.forgejo/workflows/build-epubs.yml @@ -14,7 +14,8 @@ jobs: - name: Install prerequisites run: | apt-get update - apt-get install -y --no-install-recommends ca-certificates curl xz-utils git + apt-get install -y --no-install-recommends ca-certificates curl xz-utils git \ + default-jre-headless epubcheck - uses: actions/checkout@v4 @@ -31,6 +32,9 @@ jobs: - name: Build EPUBs run: zig build run + - name: Validate EPUBs + run: ./validate.sh + - name: Commit updated EPUBs run: | set -eux @@ -59,6 +59,19 @@ zig build test # run unit tests EPUBs land in `epubs/zig-<version>.epub`. +### Validating output + +The tool guarantees well-formed XHTML, but full EPUB3 conformance (the kind of +thing Kindle's "Send to Kindle" enforces) is checked with +[epubcheck](https://github.com/w3c/epubcheck), the official validator: + +```sh +brew install epubcheck # one-time (needs a JRE) +./validate.sh # runs epubcheck on every epub; non-zero exit on errors +``` + +`validate.sh` fails loudly if any EPUB has errors, so it doubles as a CI gate. + ## Continuous integration `.forgejo/workflows/build-epubs.yml` runs on [Codeberg](https://codeberg.org) |
