8000 Documentation Issue: Inconsistent Annotation Syntax in Class Diagrams · Issue #6538 · mermaid-js/mermaid · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Documentation Issue: Inconsistent Annotation Syntax in Class Diagrams #6538

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nourhenta opened this issue Apr 27, 2025 · 0 comments · Fixed by #6541
Closed

Documentation Issue: Inconsistent Annotation Syntax in Class Diagrams #6538

nourhenta opened this issue Apr 27, 2025 · 0 comments · Fixed by #6541
Labels
Status: Triage Needs to be verified, categorized, etc

Comments

@nourhenta
Copy link
Contributor

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant
0