A tern template for structurizr diagrams
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
yuuhikaze 9f833711ca docs: the nixpkgs export failure is fixed
Drop the claim that the nixpkgs build cannot export and the distrobox
workaround; it was patched. Keep the NullPointerException as a symptom to
recognise, since it identifies a packaging fault rather than a bad DSL.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018d7Ytt5wb8uarCFsh15kVo
2026-10-04 15:49:19 -05:00
converters feat: initial structurizr tern template 2026-10-04 15:45:26 -05:00
AGENTS.md docs: the nixpkgs export failure is fixed 2026-10-04 15:49:19 -05:00
README.md docs: the nixpkgs export failure is fixed 2026-10-04 15:49:19 -05:00
tern.toml feat: initial structurizr tern template 2026-10-04 15:45:26 -05:00

structurizr-template

A tern template for exporting Structurizr DSL workspaces to a browsable static site.

Setup

In your project's .tern/config.toml:

[[templates]]
name = "structurizr-template"
url = "https://git.yhkze.net/tern/structurizr-template.git"

Usage

# 1. Install/update the template
tern --update

# 2. Export your workspaces
tern

# Re-export everything, including files tern has already seen
tern --force

What it does

Step What happens
tern --update Clones/pulls the template and installs the converter
tern Runs structurizr export on .dsl files in docs/diagrams/, writing a static site per workspace into docs-html/diagrams/

Unlike the other diagram templates, the output of each conversion is a directory, not a single file: structurizr export -format static emits index.html, workspace.js, css/ and js/. The profile therefore keeps output_file_extension = "dsl", so architecture.dsl becomes docs-html/diagrams/architecture.dsl/ and two workspaces cannot overwrite one another.

Requirements

structurizr-cli or structurizr must be on PATH — the converter probes for both, preferring structurizr-cli. Distributions disagree on the name: nixpkgs installs structurizr-cli, the AUR package installs structurizr.

Graphviz is needed for the layouts that export through dot.

If an export fails with java.lang.NullPointerException: in is null at ExportCommand.unzip, the CLI build is missing the /static.zip classpath resource that the static exporter reads. Parsing and validate still succeed in that state, so the build looks healthy until an export is attempted. The fault is in the packaging, not the DSL.

Customizing

Paths and flags belong in your .tern/config.toml, not in the installed copy — tern --update overwrites .tern/data/ and recomputes profiles from the manifest:

[[templates]]
name = "structurizr-template"
url = "https://git.yhkze.net/tern/structurizr-template.git"

[templates.overrides.structurizr]
source_root = "architecture"
output_root = "build/architecture"
options = ["-format mermaid"]

The converter forwards options[1] verbatim to structurizr export, so keep every flag in that one string rather than splitting them across list entries.