Skip to content

Commit

Permalink
Merge pull request #4296 from Will-Low/patch-2
Browse files Browse the repository at this point in the history
Updating documentation on notes for classes within class diagrams
  • Loading branch information
sidharthv96 committed Apr 23, 2023
2 parents 04305bd + 28155b0 commit 9298f63
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
18 changes: 17 additions & 1 deletion docs/syntax/classDiagram.md
Expand Up @@ -604,10 +604,26 @@ 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 <CLASS NAME> "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{
}
```

_URL Link:_

```mermaid-example
Expand Down
10 changes: 9 additions & 1 deletion packages/mermaid/src/docs/syntax/classDiagram.md
Expand Up @@ -403,10 +403,18 @@ 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 <CLASS NAME> "line1\nline2"`.

### Examples

```mermaid
classDiagram
note "This is a general note"
note for MyClass "This is a note for a class"
class MyClass{
}
```

_URL Link:_

```mmd
Expand Down

0 comments on commit 9298f63

Please sign in to comment.