The ribbon is before the note contents in the DOM. So the required SVG elements (see previous comment) can be inserted into a ribbon button icon.
I have implemented what seems to be a working version, although at this point it only covers Mermaid flowcharts. I’ll try to cover the other types of Mermaid graphs, and see how to make it readily available for everybody.
(This “solution” is still nothing more than a hack though.)
I followed the instruction for the plugin (BunkerD : you are a killer !!!).
But the plugin does not appear on the community plugin. I doubled check the installation and I can see anything wrong.
Repost: Your github instructions do not work. There is no file called main.js but a file called main.ts and the plug-in does not show up in the settings page.