Documentation Notes
Helpers and notes for building and working on these docs.
Building .svg
s from plantuml sources
.svg
s from plantuml sourcesWe use a git commit hook to automatically rebuild .svg
files from plantuml sources. The magic of git hooks means that no extra work is required by you after creating or editing a .puml
file
Behind the scenes, this hook spins up a docker container to run the PUML server and calls ./scripts/_render_svg.mjs
for each file that has changed. We use the docker version instead of the public puml server to (1) get around rate limits, and (2) ensure deterministic SVG output that is git diffable.
Creating a new PUML
Create a new
*.puml/plantuml
fileAdd the file and generate the
.svg
Update your
.md
file to refer to the newly created.svg
fileGit add/commit
Updating an existing PUML
Make changes to an existing
*.puml/plantuml
filegit add
+git commit
The pre-commit hook rebuilds the changed SVG files, and adds them before the commit
Building all .puml
sources manually
.puml
sources manuallyYou can also force a complete rebuild of all .puml
and .plantuml
sources like so:
test-svg
CI/CD Step
test-svg
CI/CD StepThis is a ci/cd step that ensures that the .svg
files have been updated correctly, just in case something got out of sync on your branch before merging a pull request.
It runs npm run build:plantuml:all
to build all of the plantuml sources and if it detects file changes, it means something went wrong with the commit hook (or you skipped it with git commit -n
).
Last updated