If you want to use an arc42 template for your system, you don’t need to use this repo - just use one of the templates you find on https://arc42.org/download.
The content (structure + embedded-help) of the arc42 template are maintained in the https://github.com/arc42/arc42-template repository.
>See section General Requirements for a brief explanation of terminology and requirements.
This repository contains a Groovy-based build system that generates arc42 templates in multiple formats and languages from the Golden Master source.
Everything runs through make, and every target runs in Docker. Java, Groovy, Pandoc and cmark live in the Docker image; nothing else is installed on your machine. make help lists all targets and variables.
-
make -
Docker with Compose v2
-
Git, to clone the repository (and for
make pinandmake release, which commit and push with your identity) -
For releases only: the GitHub CLI
gh, logged in (gh auth login)
git clone --recurse-submodules https://github.com/arc42/arc42-generator.git cd arc42-generator make image # build the Docker image once (Java, Groovy, Pandoc 3.7.0.2, cmark) make build # full arc42 build make test # all test scripts
make build:
-
checks out the arc42-template submodule (Golden Master) at the commit recorded in this repository,
-
validates the Golden Master (conditionals, help blocks, the
arc42helpattribute, images, version.properties) and stops on errors, -
generates the templates in all languages and styles and converts them to 15 output formats (HTML, PDF, Markdown variants, DOCX, EPUB, LaTeX, reStructuredText, Textile, DocBook, AsciiDoc), stopping on Asciidoctor or Pandoc diagnostics,
-
creates the distribution ZIPs in
build/dist/, together with amanifest.jsonthat lists languages (with version and date), styles, formats and every ZIP with its size and SHA-256, -
validates the output and fails on any problem: the content of every format (no leftover AsciiDoc, same headings, help texts and images as the template, well-formed DocBook/DOCX/EPUB, readable PDFs), the ZIPs against
manifest.json, the Markdown withcmark, and the includes of the AsciiDoc output.
Every run starts from a clean build/ output, so nothing from an earlier run ends up in the ZIPs. The output is reproducible: unchanged content produces byte-identical files and ZIPs (timestamps come from SOURCE_DATE_EPOCH or the last commit of the Golden Master outside dist/, not from the build time, so a merged release does not change them; every EPUB gets a fixed identifier derived from project, language and style instead of a random one).
| Target | What it does |
|---|---|
Build arc42 |
|
|
Full build: check out arc42-template, all phases, validate the output |
|
All phases (templates, convert, distribution) without checkout and output validation |
|
Phase 1: validate the Golden Master, generate the templates into |
|
Phases 2-3: discover and convert the templates |
|
Phase 4: create the distribution ZIPs |
|
Validate the output (fails on any problem): content of every format and the ZIPs, Markdown with |
|
Keep |
|
List the ZIPs of this build that differ (name, SHA-256) from those of the saved manifest; fails if any differ |
Tests |
|
|
All test scripts |
|
One test script: |
Golden Master (arc42-template submodule) |
|
|
Check out arc42-template at the recorded commit (local changes are kept; the target stops instead) |
|
Move arc42-template to the newest main, for a build of the latest translations |
|
Record the checked-out arc42-template commit in this repository (a git commit on the current branch) |
Release |
|
|
Tests and full build, then publish the ZIPs and |
|
Publish the hand-made tool files of arc42-template |
Docker image and tools |
|
|
Build the Docker image; rerun after changing the |
|
Rebuild the image without cache |
|
Show the tool versions inside the image |
|
Interactive shell in the container; the make targets work there as well |
Cleanup |
|
|
Remove |
|
Linux: give files created by the container (root) back to the calling user; the targets do this automatically |
Variables:
make convert FORMAT=html # one format only make templates OPTS="--lint=warn" # report Golden Master problems without failing make convert OPTS="--failure-level=error" # fail only on errors, not on warnings (default: warn; also fatal, none) make generate OPTS="--parallel=false" # sequential conversion make build UPDATE_TEMPLATE=1 # build the newest arc42-template main instead of the recorded commit make generate TEMPLATE=../req42-framework # another template repository, see below SOURCE_DATE_EPOCH=1751846400 make generate # fixed timestamp for DOCX/EPUB/ZIP entries make templates DOCKER_RUN_OPTS="-e FOO=bar" # extra options for docker compose run (the arc42-template CI passes GITHUB_ACTIONS this way)
docker compose up runs make build inside the container, for example in GitHub Codespaces.
Template content, including new translations, is developed in arc42-template. Its CI validates every pull request with this generator and shows each problem as annotation on the file and line.
Of a language folder the generator uses the main document, adoc/, images/ and version.properties, nothing else. In particular <LANG>/translation/ (the terms of a translation, terms.adoc) is never converted or published; a test (make test-outputcheck) guards that.
This repository records the arc42-template commit it builds (the submodule "pin"), so the same generator commit always produces the same ZIPs. When arc42-template main moves, Dependabot opens a pull request here that moves the pin; the CI of this repository builds it. To try a template change locally:
make template-update # newest arc42-template main (or: git -C arc42-template checkout <branch>) make generate # build what is checked out; 'make build' would go back to the recorded commit make pin # optional: record the commit, then open a pull request
A new language only needs its directory in arc42-template: <LANG>/ with a code such as TR, optionally with a region such as ZH-TW.
make release # release YYYY.MM.DD on arc42/arc42-template make release TAG=2026.09.30.2 # a second release on the same day make release REPO=you/arc42-template PRERELEASE=1 # test on your fork; a pre-release never becomes latest make release-tools TOOLS_TAG=tools-2026.09 # the hand-made tool files, never latest
make release builds everything with the release tag in manifest.json and publishes a GitHub Release <TAG> on arc42-template: every ZIP of the manifest and manifest.json, release notes with the version of every language, targeted at the template commit that was built. https://github.com/arc42/arc42-template/releases/latest/download/<file>; then serves the newest file, and https://arc42.org/download links there (through arc42.org/dl/<file>). Nothing is committed to arc42-template. After a release on arc42/arc42-template, make release notifies arc42.org-site (repository_dispatch template-released), which then refreshes the language and format data of the download page.
The release is first uploaded as a draft, which nobody can download. make release then downloads the draft again and compares every file with the build (SHA-256 of manifest.json); only if all files match does it publish the release. If the upload or the comparison fails, nothing is published and the draft stays; remove it with gh release delete <TAG> -R arc42/arc42-template --yes before the next attempt.
If the files equal those of the latest release (names and SHA-256 in manifest.json), nothing is published. The release targets need the GitHub CLI gh, logged in, on your machine. make release-tools publishes the hand-made tool files from the other-formats/ folders of arc42-template; they change rarely.
make check-downloads PREFIX=<url> requests every file of build/dist/manifest.json from a prefix and lists the missing ones; with CHECKSUMS=1 it downloads them and compares their SHA-256 with the manifest:
make check-downloads PREFIX=https://arc42.org/dl/ make check-downloads PREFIX=https://github.com/arc42/arc42-template/releases/latest/download/ CHECKSUMS=1
The generator is not tied to arc42. Everything project-specific lives in the config file:
-
project.name- base name of the main document (<LANG>/<name>.adoc) and of all generated files and ZIPs -
project.featurePrefix- prefix of the feature markers, e.g.[role="arc42help"]andifdef::arc42help[], and of the about page (about-arc42.adoc) -
project.logo- the only image copied into the plain style, together with the files of the same base name (e.g.arc42-logo.pngandarc42-logo.svg) -
goldenMaster.sourcePathanddistribution.targetPath- location of the sources and of the ZIPs -
distribution.languageNamesand thelabelof each format - names used inmanifest.json(a language or format without one is listed by its code)
buildconfig.groovy holds the arc42 values. Another template keeps a complete copy of this file (all sections) in its own repository and follows the layout of arc42-template: <LANG>/<name>.adoc, <LANG>/adoc/, <LANG>/images/ and <LANG>/version.properties.
Paths in a config file are relative to the directory of that file, including the build/ output.
TEMPLATE mounts the template repository into the container and uses its config; the output is written below that repository:
make templates TEMPLATE=../req42-framework make generate TEMPLATE=../req42-framework make validate TEMPLATE=../req42-framework
See the meta.arc42.org repository (internal arc42 documentation) for a step-by-step guide: self-tests, the arc42 build, building another template such as req42, and what output to expect.
The build fails on problems in the sources, in the conversion and in the output:
-
Golden Master lint (before generation): unbalanced
ifdef::arc42help[]/endif::arc42help[], help blocks that are not wrapped in a conditional, a language that usesifdef::arc42help[]but never sets:arc42help:(its with-help template would lose all help text), image references without a file in<LANG>/images/, incompleteversion.properties, and arevdate-isothat is not a monthYYYY-MMare errors; a chapter set or help-block count that differs from EN, and aversion.propertieswithoutrevdate-iso(the machine-readable month ofrevdate, written tomanifest.jsonasisoDate), are warnings. UseOPTS=--lint=warnto report instead of fail. -
Diagnostics (after conversion): Asciidoctor log records (e.g. a missing include) and Pandoc warnings (e.g. an image it could not embed into DOCX or EPUB) are printed with file and line. Records at
--failure-level(defaultwarn) or above fail the build. -
Clean output: the output directories of a phase are deleted before the phase runs.
-
Output validation (
make validate, part ofmake build): every problem is printed, then the build fails.lib/OutputCheck.groovychecks every language, style and format:-
no AsciiDoc directive or unresolved attribute is left in a rendered file, and every text file is valid UTF-8;
-
the numbers of chapter and section headings agree with the DocBook rendering, in HTML, all Markdown variants, reStructuredText, Textile, LaTeX and DOCX; the multi-page formats have one file per chapter the main document includes;
-
a style contains as many help blocks as the golden master (plain: none), and the with-help output of every format is larger than the plain one;
-
every image the template references is referenced by the output and shipped with it, or embedded (DOCX, EPUB, PDF);
-
DocBook and the XML parts of DOCX and EPUB are well-formed; every PDF has pages and extractable text;
-
manifest.jsonlists exactly one ZIP per language, style and format, and every ZIP has the size and SHA-256 of the manifest, can be read to its end and holds the files of its output directory.In addition all Markdown formats are read with
cmark, theimages/directories of the with-help styles must exist, and the includes of the AsciiDoc output must resolve.
-
-
Comparing two builds (
make manifest-save,make manifest-diff): the output is reproducible, so two builds of the same arc42-template commit differ only in the ZIPs that a change of the generator really changed. Before changing the generator, runmake build && make manifest-save; afterwardsmake build && make manifest-difflists the ZIPs that differ. A refactoring must change none. The CI does the same for every pull request and lists the differing ZIPs in the job summary.
The Docker image is optimized for size and build speed:
-
Multi-stage build: Separates build-time and runtime dependencies
-
Cached dependencies: Groovy Grape cache pre-populated during image build
-
Minimal runtime: Alpine Linux 3.20 with only essential tools
-
Pinned converter: Pandoc 3.7.0.2 from the official GitHub release (static binary, SHA-256 verified)
-
Image size: not re-measured since the pandoc change (the static pandoc binary is about 160 MB on amd64)
The container includes:
-
Java Runtime (OpenJDK 21)
-
Groovy 5.0.3
-
Pandoc 3.7.0.2 (document converter, pinned release binary with checksum)
-
cmark (CommonMark validator)
-
poppler-utils (
pdfinfo,pdftotext: the output check of the PDFs) -
GNU make and git
-
AsciidoctorJ 2.5.10 (AsciiDoc processor, bundles Asciidoctor 2.0.20) and AsciidoctorJ PDF 2.3.27
-
Droid Sans Fallback (fallback font of the PDF output for Chinese)
We need to build the template for several output formats and natural languages from a single source (the Golden Master in arc42-template).
-
Technical formats: PDF, docx, Markdown (with numerous variants), AsciiDoc, reStructuredText, Textile, HTML
-
Variantes (aka flavours): withHelp (embedded help texts), plain (no help texts)
-
Natural languages: English, German, Spanish, French, Italian, Portuguese, Chinese and others.
The arc42 requirements are collected in the meta.arc42.org repository.
For template downloads please see the arc42-template repository or the official download page on http://arc42.org/download.
