This is an example on how to add an mermaid in a JSDoc-Tutorial.
Make sure to add the script in the markdown, add the script in the staticFiles folder and set it up accodingly in the jsdoc config file as shown in the gist.
You then can add mermaids in the same way as in GitLab: