From 4bf9e636b93df1e7827b87a2a82df9154be1fe45 Mon Sep 17 00:00:00 2001 From: Danny Ben Shitrit Date: Wed, 3 Dec 2025 19:00:48 +0000 Subject: [PATCH] - Enable mermaid by default --- README.md | 28 +++++++++++----------- lib/madness/settings.rb | 2 +- lib/madness/templates/madness.yml | 4 ++-- site/index.html | 22 ++++++++--------- spec/approvals/cli/config/show | 2 +- spec/approvals/cli/config/show-non-default | 2 +- spec/approvals/render/all-disabled | 24 ++++++++----------- 7 files changed, 40 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index f7b34c6..27f22c3 100644 --- a/README.md +++ b/README.md @@ -149,8 +149,8 @@ auto_toc: true highlighter: true # enable mermaid diagramming and charting -# put your diagram code inside
...
-mermaid: false +# put your diagram code inside ```mermaid ... ``` code fence +mermaid: true # enable the copy to clipboard icon for code snippets copy_code: true @@ -264,18 +264,6 @@ file or a directory in the same directory as the file itself. When the `mermaid` option is enabled, you can embed Mermaid diagrams in your document using either of the following methods: -**Using a `
` block with `mermaid` class**: - - ```html -
- graph TD; - A-->B; - A-->C; - B-->D; - C-->D; -
- ``` - **Using a code fence with `mermaid` language specifier**: ````markdown @@ -287,6 +275,18 @@ document using either of the following methods: C-->D; ``` ```` + +**Using a `
` block with `mermaid` class**: + + ```html +
+ graph TD; + A-->B; + A-->C; + B-->D; + C-->D; +
+ ``` ### Table of Contents Generation diff --git a/lib/madness/settings.rb b/lib/madness/settings.rb index 73e3fa7..4e780cd 100644 --- a/lib/madness/settings.rb +++ b/lib/madness/settings.rb @@ -63,7 +63,7 @@ def defaults auto_nav: true, auto_toc: true, highlighter: true, - mermaid: false, + mermaid: true, copy_code: true, shortlinks: false, source_link: nil, diff --git a/lib/madness/templates/madness.yml b/lib/madness/templates/madness.yml index 0d5eafb..247928b 100644 --- a/lib/madness/templates/madness.yml +++ b/lib/madness/templates/madness.yml @@ -43,8 +43,8 @@ auto_toc: true highlighter: true # enable mermaid diagramming and charting -# put your diagram code inside
...
-mermaid: false +# put your diagram code inside ```mermaid ... ``` code fence +mermaid: true # enable the copy to clipboard icon for code snippets copy_code: true diff --git a/site/index.html b/site/index.html index ce26032..b0ba969 100644 --- a/site/index.html +++ b/site/index.html @@ -172,8 +172,8 @@

Configuration File

highlighter: true # enable mermaid diagramming and charting -# put your diagram code inside <div class='mermaid'>...</div> -mermaid: false +# put your diagram code inside ```mermaid ... ``` code fence +mermaid: true # enable the copy to clipboard icon for code snippets copy_code: true @@ -284,15 +284,6 @@

Mermaid Diagrams and Charts

When the mermaid option is enabled, you can embed Mermaid diagrams in your document using either of the following methods:

-

Using a <div> block with mermaid class:

-
   <div class="mermaid">
-     graph TD;
-     A-->B;
-     A-->C;
-     B-->D;
-     C-->D;
-   </div>
-

Using a code fence with mermaid language specifier:

   ```mermaid
    graph TD;
@@ -302,6 +293,15 @@ 

Mermaid Diagrams and Charts

C-->D;
```
+

Using a <div> block with mermaid class:

+
   <div class="mermaid">
+     graph TD;
+     A-->B;
+     A-->C;
+     B-->D;
+     C-->D;
+   </div>
+

Table of Contents Generation

Site-wide

diff --git a/spec/approvals/cli/config/show b/spec/approvals/cli/config/show index 56656aa..5a0ed1a 100644 --- a/spec/approvals/cli/config/show +++ b/spec/approvals/cli/config/show @@ -9,7 +9,7 @@ auto_nav: true auto_toc: true highlighter: true - mermaid: ~ + mermaid: true copy_code: true shortlinks: ~ source_link: ~ diff --git a/spec/approvals/cli/config/show-non-default b/spec/approvals/cli/config/show-non-default index 1236784..31ae9bc 100644 --- a/spec/approvals/cli/config/show-non-default +++ b/spec/approvals/cli/config/show-non-default @@ -9,7 +9,7 @@ auto_nav: true auto_toc: true highlighter: true - mermaid: ~ + mermaid: true copy_code: true shortlinks: ~ source_link: ~ diff --git a/spec/approvals/render/all-disabled b/spec/approvals/render/all-disabled index a8fb499..96c6823 100644 --- a/spec/approvals/render/all-disabled +++ b/spec/approvals/render/all-disabled @@ -12,12 +12,10 @@ with markdown support in it

Inline code_word and block code:

- -
def say(message = "Hi")
-  puts message
-end
-
- +
def say(message = "Hi")
+  puts message
+end
+

Footnotes, Images

This needs a footnote explanation1

@@ -112,14 +110,12 @@ graph TD;

Or using the mermaid code block:

- -
graph TD;
-    A-->B;
-    A-->C;
-    B-->D;
-    C-->D;
-
- +
graph TD; + A-->B; + A-->C; + B-->D; + C-->D; +

Unsafe HTML

This is calculated by Javascript: