Skip to content

Commit

Permalink
docs: added plantuml generation script
Browse files Browse the repository at this point in the history
  • Loading branch information
Rugvip committed Jun 9, 2020
1 parent c8294b3 commit 250db6c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/generate-uml.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 250db6c

Please sign in to comment.