Documentation Issue: Inconsistent Annotation Syntax in Class Diagrams · Issue #6538 · mermaid-js/mermaid · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Class Diagram documentation, there are two different ways shown for annotating a class using << >> syntax: 1. Separate Line After Class Definition
classDiagram
class Shape
<<interface>> Shape
2. Inline with Class Definition
classDiagram
class Shape <<interface>>
However, the documentation does not clarify:
Whether both methods are equally valid,
Whether there are any differences in behavior,
Which method is preferred for consistency and best practices.
This lack of explanation can confuse users, especially newcomers, about which style to use and whether one is more reliable. Verification
Testing both methods in the Mermaid Live Editor confirms that both styles currently work and produce identical diagrams.
Still, it would be helpful for the documentation to explicitly state this and recommend a consistent style. Suggested Improvement
Clarify that both syntaxes are valid and interchangeable (if that is the case).
Optionally recommend one preferred style (e.g., inline or separate line) for better readability and consistency across diagrams.
Include examples showing both methods clearly, mentioning that users are free to choose either.
The text was updated successfully, but these errors were encountered:
In the Class Diagram documentation, there are two different ways shown for annotating a class using << >> syntax:
1. Separate Line After Class Definition
2. Inline with Class Definition
However, the documentation does not clarify:
This lack of explanation can confuse users, especially newcomers, about which style to use and whether one is more reliable.
Verification
Testing both methods in the Mermaid Live Editor confirms that both styles currently work and produce identical diagrams.
Still, it would be helpful for the documentation to explicitly state this and recommend a consistent style.
Suggested Improvement
The text was updated successfully, but these errors were encountered: