Skip to content

Add Mermaid diagrams, linting, and slide layout improvements#3

Merged
stiffneckjim merged 15 commits into
developfrom
feature/add-network-diagrams
May 25, 2026
Merged

Add Mermaid diagrams, linting, and slide layout improvements#3
stiffneckjim merged 15 commits into
developfrom
feature/add-network-diagrams

Conversation

@stiffneckjim
Copy link
Copy Markdown
Contributor

Summary

Full feature branch covering Mermaid diagram support, tooling, and presentation layout improvements.

Changes

Mermaid diagrams

  • Added network architecture and demo flow diagrams to slides
  • Post-build injection script (inject-mermaid.mjs) transforms Marp's language-mermaid code blocks into <pre class="mermaid"> elements that Mermaid.js can render
  • Uses JSDOM for reliable HTML parsing rather than string replacement

Slide layout

  • Switched diagrams from top-down to left-right layout to fit 16:9 slides
  • Added front-matter CSS to reduce font size and enable vertical scrolling on content-heavy slides
  • Removed DNS sequence diagram (better suited to documentation than presentations)

Linting

  • Added Biome for JavaScript linting (scripts/)
  • Added markdownlint-cli2 for Markdown linting (slides.md)
  • pnpm lint runs both; CI runs lint before build on every branch

CI

  • test-build.yml now runs pnpm lint before pnpm build

- Add network architecture diagram showing Pi-hole placement
- Add DNS query flow sequence diagram (blocked vs allowed)
- Add demo flow diagram
- Enhance key takeaways and add questions slide with resources
- Add http-server as dev dependency on port 8001
- Add 'serve' and 'preview' npm scripts for local browsing
- Add marp.config.js with Mermaid configuration
- Create inject-mermaid.mjs post-build script to load mermaid.js CDN
- Update build.mjs to run Mermaid injection after Marp build
- Diagrams now render properly in browser
Use a directory target for Marp server mode so `pnpm dev` starts successfully.
Copilot AI review requested due to automatic review settings May 25, 2026 22:37
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the Marp-based slide deck by adding Mermaid diagram support (via post-build HTML transformation + Mermaid.js injection), improving slide layout for 16:9 presentation delivery, and introducing JS/Markdown linting with CI enforcement.

Changes:

  • Add Mermaid diagrams to slides.md and inject Mermaid.js into the built dist/index.html via a new scripts/inject-mermaid.mjs post-processing step.
  • Add linting tooling (Biome for scripts/, markdownlint-cli2 for slides.md) and run lint in CI before building.
  • Update slide styling/front-matter to reduce font sizes and allow vertical scrolling for content-heavy slides.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
slides.md Adds new agenda/content structure, Mermaid diagrams, and global slide CSS for sizing/scroll.
scripts/inject-mermaid.mjs New post-build transformer that converts language-mermaid code blocks into Mermaid-renderable <pre class="mermaid"> and injects Mermaid.js.
scripts/build.mjs Runs Marp with a config file and executes the Mermaid injection script after build.
marp.config.js Enables HTML in Marp output and adds Mermaid-related config.
package.json Adds preview/serve + lint scripts and new devDependencies (Biome, jsdom, markdownlint, http-server).
biome.json Adds Biome lint/format configuration.
.markdownlintrc.json Adds markdownlint configuration for slides.md.
.github/workflows/test-build.yml Runs pnpm lint prior to pnpm build in CI.
pnpm-workspace.yaml Adds a pnpm workspace file (currently appears placeholder/misconfigured).
pnpm-lock.yaml Updates lockfile for added tooling dependencies.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/build.mjs Outdated
Comment thread pnpm-workspace.yaml Outdated
Comment on lines +1 to +2
allowBuilds:
'@biomejs/biome': set this to true or false
Comment thread scripts/inject-mermaid.mjs Outdated
Comment thread slides.md
Comment thread package.json
Comment on lines +21 to +25
"@biomejs/biome": "^1.9.4",
"@marp-team/marp-cli": "^4.1.0",
"http-server": "^14.1.0",
"jsdom": "^29.1.1",
"markdownlint-cli2": "^0.15.0"
Comment thread marp.config.js
Comment on lines +1 to +5
module.exports = {
html: true,
markdown: {
html: true,
},
Comment thread scripts/inject-mermaid.mjs Outdated
Comment on lines +60 to +63
</body>`;

html = html.replace("</body>", mermaidScript);
}
- build.mjs: fix trailing whitespace and closing-brace formatting
- pnpm-workspace.yaml: replace invalid placeholder with comment; move
  onlyBuiltDependencies allowlist to package.json pnpm field
- package.json: bump engines.node to >=20.19.0 to match jsdom requirement
- inject-mermaid.mjs: pin Mermaid CDN to 10.9.3; use JSDOM DOM API
  (appendChild) instead of string replace for script injection
- slides.md: consolidate Mermaid SVG styles into frontmatter CSS as the
  single source of truth for both dev and build; remove duplicate from
  inject-mermaid.mjs
- marp.config.js: document why html:true is required (br tags in labels)
- make dev pipeline build dist via scripts/build.mjs so Mermaid transform/injection runs
- serve dist with http-server during dev
- auto-select an available port starting at 8080 to avoid recurring port conflicts
Copy link
Copy Markdown
Contributor Author

@stiffneckjim stiffneckjim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took a while but finally looks good.

@stiffneckjim stiffneckjim merged commit 69bb144 into develop May 25, 2026
@stiffneckjim stiffneckjim deleted the feature/add-network-diagrams branch May 25, 2026 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants