diff --git a/build-slides.sh b/build-slides.sh index 41a05ac..42d4281 100755 --- a/build-slides.sh +++ b/build-slides.sh @@ -19,7 +19,11 @@ fi echo "Found ${#SLIDES[@]} presentation(s):" printf ' %s\n' "${SLIDES[@]}" -if command -v marp &>/dev/null; then +CONFIG="$REPO_ROOT/marp.config.mjs" + +if command -v npx &>/dev/null && [ -f "$CONFIG" ]; then + npx @marp-team/marp-cli --config "$CONFIG" --html --output "$OUTPUT_DIR/" "${SLIDES[@]}" +elif command -v marp &>/dev/null; then marp --html --output "$OUTPUT_DIR/" "${SLIDES[@]}" else echo "marp not found locally — using Docker (marpteam/marp-cli)..." diff --git a/docs/infrastruktur/labdesign.md b/docs/infrastruktur/labdesign.md index a284548..c741dc1 100644 --- a/docs/infrastruktur/labdesign.md +++ b/docs/infrastruktur/labdesign.md @@ -1,8 +1,15 @@ --- marp: true -pagination: true +theme: gaia +class: invert +paginate: true --- + + # Introduction This is assorted notes on what could go into the MakerFLOSS lab @@ -127,7 +134,7 @@ graph TB Firewall --> BackupSrv ``` -ß--- +--- ## Long term diff --git a/marp.config.mjs b/marp.config.mjs new file mode 100644 index 0000000..21f911d --- /dev/null +++ b/marp.config.mjs @@ -0,0 +1,21 @@ +import { Marp } from '@marp-team/marp-core' + +// Custom Marp engine with Mermaid support via HTML injection +export default { + html: true, + engine: (constructorOptions) => { + const marp = new Marp(constructorOptions) + + // Transform mermaid code blocks to divs that mermaid.js can render + const { code } = marp.markdown.renderer.rules + marp.markdown.renderer.rules.code = (tokens, idx, options, env, self) => { + const token = tokens[idx] + if (token.info.trim() === 'mermaid') { + return `