From e6e63dfd200492b56ee50baf66f42abd32111def Mon Sep 17 00:00:00 2001 From: Jo Walsh Date: Thu, 11 Jul 2024 11:03:48 +0100 Subject: [PATCH] tweak graph render to output where Jekyll does --- docs/diagrams/index.md | 1 + scripts/render_diagrams.sh | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/diagrams/index.md b/docs/diagrams/index.md index 566b09c..a819b0c 100644 --- a/docs/diagrams/index.md +++ b/docs/diagrams/index.md @@ -8,6 +8,7 @@ title: Plankton ML - workflow diagrams # Workflow Diagrams + ![From imaging instrument to cloud storage](as_is/instrument_to_store.svg) - as is ![From imaging instrument to cloud storage](could_be/instrument_to_store.svg) - as is diff --git a/scripts/render_diagrams.sh b/scripts/render_diagrams.sh index 68093e7..7cb583b 100644 --- a/scripts/render_diagrams.sh +++ b/scripts/render_diagrams.sh @@ -3,6 +3,7 @@ # Set the directory path DIR="./docs/diagrams/" +SITE="_site/" # Loop through each subdirectory for sub_dir in "$DIR"*/; do @@ -10,12 +11,15 @@ for sub_dir in "$DIR"*/; do for dotfile in "$sub_dir"*.dot; do # Get the base name without extension base_name=$(basename "$dotfile" .dot) - + dir_path=${sub_dir//docs/docs\/_site} + mkdir -p $dir_path + output="$dir_path$base_name.svg" + # Render the dot file to SVG - dot -Tsvg "$dotfile" -o "$sub_dir$base_name.svg" + dot -Tsvg "$dotfile" -o $output # Print a success message - echo "Rendered $dotfile to $sub_dir$base_name.svg" + echo "Rendered $dotfile to $output" done done