Merge branch 'main' of ssh://gitea.apps.sustainabledelivery.com:3022/learning-hours/db-subclass-to-dto
# Conflicts: # after-dto.mmd.svg # before-after-dto.mmd.svg
This commit is contained in:
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
# Render a mermaid diagram to SVG using mmdc with sandbox/GPU workarounds
|
||||
# for Ubuntu 24.04+ (AppArmor restrictions).
|
||||
#
|
||||
# Usage: scripts/mermaid.sh input.mmd [output.svg]
|
||||
# scripts/mermaid.sh input.mmd - # output to stdout
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
CONFIG="$REPO_ROOT/puppeteer.config.json"
|
||||
|
||||
if [[ $# -lt 1 ]]; then
|
||||
echo "Usage: $0 <input.mmd> [output.svg|-]" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
INPUT="$1"
|
||||
shift
|
||||
|
||||
ARGS=("-i" "$INPUT" "-p" "$CONFIG")
|
||||
|
||||
if [[ $# -gt 0 ]]; then
|
||||
OUTPUT="$1"
|
||||
shift
|
||||
ARGS+=("-o" "$OUTPUT")
|
||||
fi
|
||||
|
||||
ARGS+=("$@")
|
||||
|
||||
exec mmdc "${ARGS[@]}"
|
||||
Reference in New Issue
Block a user