Skip to content

Commit

Permalink
update script file
Browse files Browse the repository at this point in the history
  • Loading branch information
timohuber committed Jul 12, 2024
1 parent 089fc33 commit 8904de7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion .github/workflows/jekyll-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
image: minlag/mermaid-cli:latest
options: -v ${{ github.workspace }}:/app -w /app
run: |
ls ./scripts
chmod +x ./scripts/render-images.sh
./scripts/render-images.sh
- name: Upload artifacts
Expand Down
6 changes: 5 additions & 1 deletion scripts/render-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
input_dir="diagrams"
output_dir="docs/images"

command_path=$( [ -z "$CI" ] && echo "." || echo "/home/mermaidcli" )
config_path=$( [ -z $CI ] && echo "." || echo "")

echo "Start rendering mermaid diagrams"

for file in "$input_dir"/*.mmd; do
echo "rendering $file"

base_name=$(basename "$file" .mmd)
./node_modules/.bin/mmdc -p puppeteer-config.json -i "$file" -o "$output_dir/${base_name}.svg" -b transparent
"$command_path/node_modules/.bin/mmdc" -p "$config_path/puppeteer-config.json" -i "$file" -o "$output_dir/${base_name}.svg" -b transparent
done

echo "Rendering mermaid diagrams completed."

0 comments on commit 8904de7

Please sign in to comment.