From 250db6cc2a3f505aa1206a860e760ffc8bc3c625 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 9 Jun 2020 15:55:44 +0200 Subject: [PATCH] docs: added plantuml generation script --- docs/generate-uml.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 docs/generate-uml.sh diff --git a/docs/generate-uml.sh b/docs/generate-uml.sh new file mode 100755 index 0000000000..55117838ea --- /dev/null +++ b/docs/generate-uml.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# This script uses plantuml to generate SVG images from inline plantuml descriptions. +# See ./auth/oauth.md for an example. +# +# You need to have plantuml installed (brew install plantuml, or some other method). +# +# Either call directly to generate diagrams for all markdown files in this directory, +# or add a --watch flag to rebuild SVGs on changes. + +cd "$( dirname "${BASH_SOURCE[0]}" )" + +if [[ "$1" == '--watch' ]]; then + npx --no-install nodemon --ext md --exec './generate-uml.sh' +fi + +grep '@startuml' -rl --include '*.md' . | while read -r file ; do + echo "Generating : $file" + plantuml -tsvg "$file" 2> >(grep -v "CoreText note:") +done