Skip to content

Fix Mermaid diagram rendering in documentation#235

Merged
lostcontrol merged 3 commits into
masterfrom
fix-mermaid-rendering-1751822349081085163
Jul 17, 2026
Merged

Fix Mermaid diagram rendering in documentation#235
lostcontrol merged 3 commits into
masterfrom
fix-mermaid-rendering-1751822349081085163

Conversation

@lostcontrol

Copy link
Copy Markdown
Owner

Fixes an issue where Mermaid diagrams were displaying as raw text instead of rendering in the Jekyll documentation. The script responsible for initializing Mermaid has been corrected to handle Kramdown's HTML output structure accurately.

I have deployed a local Jekyll server to port 3000 where you can see the fix in action.


PR created automatically by Jules for task 1751822349081085163 started by @lostcontrol

The custom script in `docs/_includes/head-custom.html` was incorrectly
looking for a child `<code>` element inside `.language-mermaid` elements.
However, Kramdown directly applies the `language-mermaid` class to the
`<code>` element itself. This commit updates the script to check if the
element is a `CODE` tag, and if so, it replaces its parent `<pre>`
element with a `<div class="mermaid">` element containing the raw diagram
code.

Also adds `.gitignore` exclusions for `docs/_site/` and `node_modules/`
to prevent pre-commit hooks from failing on generated files.

Co-authored-by: lostcontrol <983305+lostcontrol@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

Coverage

Coverage Report
FileStmtsMissCoverMissing
controller
   actor.py611084%41–42, 63, 74, 80–84, 104
   arduino.py44440%18–81
   config.py11191%32
   device.py28816443%44, 47, 50, 53, 56–57, 64–65, 68–69, 72, 78, 81, 91, 95, 117–122, 125, 128, 131–134, 145–147, 177, 182, 189–192, 195–196, 201–220, 225–228, 232–244, 249–259, 262–264, 269–270, 273–291, 296–302, 305–307, 311–312, 315, 318, 321, 326–327, 332, 335–364, 367–390, 395–398, 401, 405
   disinfection.py1588447%48–52, 64, 66, 87–88, 95–98, 101–102, 119–145, 148–149, 152–153, 156–157, 160–161, 165–166, 169–170, 173, 176–184, 187–189, 192–196, 199–215, 218–220
   dispatcher.py38380%18–329
   filtration.py61242331%74, 82–84, 94, 97, 100, 106, 118–120, 129, 132, 140–145, 148–153, 156–161, 164–168, 171–174, 177, 180–189, 221–309, 312–315, 318–323, 326–328, 331–332, 335–336, 339–341, 344, 347, 350–352, 355–356, 359–364, 367–372, 375–380, 383–387, 390–391, 394–395, 398–402, 405–406, 409–411, 414–416, 419–421, 424–425, 428, 431, 434–440, 443, 446, 449–451, 454–461, 464–477, 480–481, 485–493, 496–507, 510–514, 518–526, 529–537, 540–544, 547–552, 555–564, 568–572, 575–587, 591–599, 602–607, 610, 614–618, 621–624, 627–630, 633–634, 639, 642, 645, 649–653, 656–666, 669–670, 673–679, 683–693, 696–698, 701–707, 710, 714–720, 723–727, 730–734, 737–738, 741–743, 746–751, 755–768, 771–772, 775–776, 779–781, 784–792, 795–798, 801–804, 807–812, 816–818, 821–826, 829–832, 835–837
   heating.py1881880%18–269
   lcd.py55984%36–44
   light.py22220%18–50
   mqtt.py47470%18–78
   sensor.py994258%33, 42, 51, 55, 58–61, 69–70, 73, 76, 79–80, 87–89, 92–98, 110, 113, 127–128, 135–137, 140–152
   swim.py822570%63–64, 77–78, 87–89, 92–97, 110–112, 115–120, 123–126
   tank.py1101100%18–163
TOTAL1899120736% 

Tests Skipped Failures Errors Time
99 0 💤 0 ❌ 0 🔥 19.568s ⏱️

Comment thread .bundle/config Outdated
The custom script in `docs/_includes/head-custom.html` was incorrectly
looking for a child `<code>` element inside `.language-mermaid` elements.
However, Kramdown directly applies the `language-mermaid` class to the
`<code>` element itself. This commit updates the script to check if the
element is a `CODE` tag, and if so, it replaces its parent `<pre>`
element with a `<div class="mermaid">` element containing the raw diagram
code.

Also adds `.gitignore` exclusions for `docs/_site/` and `node_modules/`
to prevent pre-commit hooks from failing on generated files, and removes
accidental `.bundle/config` inclusions.

Co-authored-by: lostcontrol <983305+lostcontrol@users.noreply.github.com>
Comment thread docs/Gemfile Outdated
Comment thread .gitignore
The custom script in `docs/_includes/head-custom.html` was incorrectly
looking for a child `<code>` element inside `.language-mermaid` elements.
However, Kramdown directly applies the `language-mermaid` class to the
`<code>` element itself. This commit updates the script to check if the
element is a `CODE` tag, and if so, it replaces its parent `<pre>`
element with a `<div class="mermaid">` element containing the raw diagram
code.

Co-authored-by: lostcontrol <983305+lostcontrol@users.noreply.github.com>
@lostcontrol
lostcontrol merged commit 796cd14 into master Jul 17, 2026
1 check passed
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.

1 participant