File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <!-- Load Mermaid.js from a CDN -->
2+ < script src ="https://unpkg.com/mermaid@11/dist/mermaid.min.js "> </ script >
3+
4+ <!-- Initialize Mermaid when the page loads -->
5+ < script >
6+ document . addEventListener ( "DOMContentLoaded" , function ( ) {
7+ // Select all code blocks with 'language-mermaid'
8+ document . querySelectorAll ( 'pre code.language-mermaid' ) . forEach ( function ( codeBlock ) {
9+ // Extract the mermaid code
10+ const mermaidCode = codeBlock . textContent . trim ( ) ;
11+
12+ // Create a new div with class 'mermaid'
13+ const mermaidDiv = document . createElement ( 'div' ) ;
14+ mermaidDiv . className = 'mermaid' ;
15+ mermaidDiv . textContent = mermaidCode ;
16+
17+ // Replace the parent <pre> block with our new mermaid div
18+ const pre = codeBlock . parentNode ;
19+ pre . parentNode . replaceChild ( mermaidDiv , pre ) ;
20+ } ) ;
21+
22+ // Now initialize Mermaid
23+ mermaid . initialize ( { startOnLoad : true } ) ;
24+ } ) ;
25+ </ script >
Original file line number Diff line number Diff line change 88 < link rel ="stylesheet " href ="{{ site.baseurl }}/assets/css/columns.css ">
99
1010 {% include mathjax_support.html %}
11+ {% include mermaid_support.html %}
1112 </ head >
1213 < body >
1314 < div class ="container-lg px-3 my-5 markdown-body ">
You can’t perform that action at this time.
0 commit comments