diff --git a/build-slides.sh b/build-slides.sh index 41a05ac..3bd3b60 100755 --- a/build-slides.sh +++ b/build-slides.sh @@ -33,4 +33,44 @@ else marpteam/marp-cli --html --output /home/marp/output "${REL_SLIDES[@]}" fi +# Inject mermaid.js into any HTML that contains mermaid code blocks. +# Marp emits fenced mermaid blocks as
.
+# The script finds those elements, replaces them with ,
+# then loads and runs mermaid.js from CDN.
+inject_mermaid() {
+ local html_file="$1"
+ python3 - "$html_file" << 'PYEOF'
+import sys
+
+path = sys.argv[1]
+snippet = """\
+"""
+
+content = open(path).read()
+open(path, 'w').write(content.replace('