From 19363965adae87e8eb37eb835fa38a8453f1f1c7 Mon Sep 17 00:00:00 2001 From: Will-Low <26700668+Will-Low@users.noreply.github.com> Date: Thu, 13 Apr 2023 09:08:48 -0700 Subject: [PATCH 1/3] Updating documentation on notes for classes I was confused by the documentation on notes for a specific class. Updated the wording slightly and added an example for clarity. --- .../mermaid/src/docs/syntax/classDiagram.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/mermaid/src/docs/syntax/classDiagram.md b/packages/mermaid/src/docs/syntax/classDiagram.md index 9d3766590..f824b0bfc 100644 --- a/packages/mermaid/src/docs/syntax/classDiagram.md +++ b/packages/mermaid/src/docs/syntax/classDiagram.md @@ -403,10 +403,26 @@ click className href "url" "tooltip" ## Notes -It is possible to add notes on diagram using `note "line1\nline2"` or note for class using `note for class "line1\nline2"` +It is possible to add notes on the diagram using `note "line1\nline2"`. A note can be added for a specific class using `note for "line1\nline2"`. ### Examples +```mmd +classDiagram + note "This is a general note" + note for MyClass "This is a note for a class" + class MyClass{ + } +``` + +```mermaid +classDiagram + note "This is a general note" + note for MyClass "This is a note for a class" + class MyClass{ + } +``` + _URL Link:_ ```mmd From e3ca0031273443d12d1ac2008978bacd84d4932b Mon Sep 17 00:00:00 2001 From: Will-Low <26700668+Will-Low@users.noreply.github.com> Date: Thu, 13 Apr 2023 09:59:11 -0700 Subject: [PATCH 2/3] Rebuilding docs --- docs/syntax/classDiagram.md | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/docs/syntax/classDiagram.md b/docs/syntax/classDiagram.md index 69144ef39..9c8f8aadb 100644 --- a/docs/syntax/classDiagram.md +++ b/docs/syntax/classDiagram.md @@ -604,10 +604,42 @@ You would define these actions on a separate line after all classes have been de ## Notes -It is possible to add notes on diagram using `note "line1\nline2"` or note for class using `note for class "line1\nline2"` +It is possible to add notes on the diagram using `note "line1\nline2"`. A note can be added for a specific class using `note for "line1\nline2"`. ### Examples +```mermaid-example +classDiagram + note "This is a general note" + note for MyClass "This is a note for a class" + class MyClass{ + } +``` + +```mermaid +classDiagram + note "This is a general note" + note for MyClass "This is a note for a class" + class MyClass{ + } +``` + +```mermaid-example +classDiagram + note "This is a general note" + note for MyClass "This is a note for a class" + class MyClass{ + } +``` + +```mermaid +classDiagram + note "This is a general note" + note for MyClass "This is a note for a class" + class MyClass{ + } +``` + _URL Link:_ ```mermaid-example From 28155b0e0a30aef8898985e2967f982a7fa99e42 Mon Sep 17 00:00:00 2001 From: Will-Low <26700668+Will-Low@users.noreply.github.com> Date: Mon, 17 Apr 2023 07:29:17 -0700 Subject: [PATCH 3/3] Removing redundant code block --- docs/syntax/classDiagram.md | 16 ---------------- packages/mermaid/src/docs/syntax/classDiagram.md | 8 -------- 2 files changed, 24 deletions(-) diff --git a/docs/syntax/classDiagram.md b/docs/syntax/classDiagram.md index 9c8f8aadb..15ae26444 100644 --- a/docs/syntax/classDiagram.md +++ b/docs/syntax/classDiagram.md @@ -624,22 +624,6 @@ classDiagram } ``` -```mermaid-example -classDiagram - note "This is a general note" - note for MyClass "This is a note for a class" - class MyClass{ - } -``` - -```mermaid -classDiagram - note "This is a general note" - note for MyClass "This is a note for a class" - class MyClass{ - } -``` - _URL Link:_ ```mermaid-example diff --git a/packages/mermaid/src/docs/syntax/classDiagram.md b/packages/mermaid/src/docs/syntax/classDiagram.md index f824b0bfc..d019774b2 100644 --- a/packages/mermaid/src/docs/syntax/classDiagram.md +++ b/packages/mermaid/src/docs/syntax/classDiagram.md @@ -407,14 +407,6 @@ It is possible to add notes on the diagram using `note "line1\nline2"`. A note c ### Examples -```mmd -classDiagram - note "This is a general note" - note for MyClass "This is a note for a class" - class MyClass{ - } -``` - ```mermaid classDiagram note "This is a general note"