Mermaid Comments | How To Write Comments in Mermaid.js

Mermaid Comments

You can add comments in Mermaid.js after double percent signs %%

%% This is a comment in Mermaid.js

The comments functionality was added in Mermaid.js release 0.2.16.

Initially, there were some issues with the Mermaid comments implementation. For example, comments were not working on class diagrams, but the issue was fixed on Dec 2, 2019.

Why Should I Use Mermaid Comments?

Depending on the purpose of your program, comments can serve as notes to yourself or reminders, or they can be written with the intention of other programmers being able to understand what your code is doing.

In general, it is a good idea to write comments while you are writing or updating a program as it is easy to forget your thought process later on, and comments written later may be less useful in the long term.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.