Skip to content

Commit 688228e

Browse files
committed
Simplify Mermaid implementation with standard approach
1 parent 53941de commit 688228e

File tree

2 files changed

+10
-25
lines changed

2 files changed

+10
-25
lines changed

dox-theme/_layouts/default.html

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
<!-- Theme scripts (deferred) -->
1919
<script src="{{ site.baseurl }}/dox-theme/assets/js/vendor/jquery.min.js" defer></script> <!-- Keep vendor -->
2020
<script src="{{ site.baseurl }}/dox-theme/assets/js/vendor/highlight.pack.js" defer></script> <!-- Keep vendor -->
21-
<script src="https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js"></script>
2221
<script src="{{ site.baseurl }}/dox-theme/assets/js/theme-toggle.js" defer></script> <!-- Restore -->
2322
<script src="{{ site.baseurl }}/dox-theme/assets/js/navigation.js" defer></script> <!-- Keep navigation.js -->
2423
<script src="{{ site.baseurl }}/dox-theme/assets/js/page-nav.js" defer></script> <!-- Restore -->
@@ -61,7 +60,7 @@ <h1 class="c-page-header__title">{{ page.title }}</h1>
6160

6261
{% include footer.html bordered=true %}
6362

64-
<!-- Initialize highlighting and Mermaid after defer ensures libraries are loaded -->
63+
<!-- Initialize highlighting -->
6564
<script defer>
6665
document.addEventListener('DOMContentLoaded', (event) => {
6766
// Initialize Highlight.js
@@ -70,24 +69,13 @@ <h1 class="c-page-header__title">{{ page.title }}</h1>
7069
} else {
7170
console.error('Highlight.js (hljs) not loaded');
7271
}
73-
74-
// Initialize Mermaid
75-
if (typeof mermaid !== 'undefined') {
76-
mermaid.initialize({
77-
startOnLoad: true,
78-
theme: 'dark',
79-
themeVariables: {
80-
primaryColor: '#7fb100',
81-
secondaryColor: '#446200',
82-
tertiaryColor: '#4682b4'
83-
}
84-
});
85-
} else {
86-
console.error('Mermaid.js not loaded');
87-
}
8872
});
8973
</script>
9074

75+
<!-- Mermaid -->
76+
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
77+
<script>mermaid.initialize({startOnLoad:true});</script>
78+
9179
{% if site.dox.google_analytics.tracking_code and jekyll.environment == 'production' %}
9280
<!-- Google Analytics -->
9381
<script>

guides/index.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,13 @@ MainWP uses specific terminology to distinguish between different types of add-o
4545

4646
Use this decision tree to determine whether you should build an Extension or an Integration:
4747

48-
<pre class="mermaid">
48+
<div class="mermaid">
4949
flowchart TD
50-
A[Do you need to connect with
51-
a third-party service or plugin?] -->|Yes| B[Integration]
50+
A[Do you need to connect with a third-party service or plugin?] -->|Yes| B[Integration]
5251
A -->|No| C[Extension]
53-
B --> D[Examples: WooCommerce Integration,
54-
Google Analytics Integration]
55-
C --> E[Examples: Advanced Uptime Monitor,
56-
Advanced Reports Extension]
57-
</pre>
52+
B --> D[Examples: WooCommerce Integration, Google Analytics Integration]
53+
C --> E[Examples: Advanced Uptime Monitor, Advanced Reports Extension]
54+
</div>
5855

5956
## Who These Guides Are For
6057

0 commit comments

Comments
 (0)