Specifically, I want to use icon packs (like AWS or cloud architecture icons) within my Mermaid diagrams in Obsidian. From what I understand, this feature requires support for custom icon packs using JavaScript and configuration in Mermaid’s themeVariables or config.
I couldn’t find any native option or existing Obsidian plugin that supports adding external icon packs to Mermaid diagrams (e.g., like the @mermaid-js/mermaid-chart wrapper). Could you clarify:
Is there any plugin or method to enable AWS icon support in Mermaid within Obsidian?
If not, is there a way to inject custom JavaScript (e.g., to load icon packs) for use in Mermaid renderings?
Is this something that can be accomplished with a custom plugin, or should I file a feature request to the Mermaid or Obsidian teams directly?
If writing a script is required, I’d appreciate some guidance or examples for integrating custom icons or the @mermaid-js/mermaid-chart toolchain into the Obsidian environment.
Thanks in advance for your help and any recommendations you can share!
First, mermaid api has to be made accessible for use within js (eg, within dataviewjs blocks). This requires to write a minimal plugin.
A snippet of code must be run to load the icon pack. This can be written inside a dataviewjs (or as part of the minimal plugin, if you prefer, but using dataviewjs allows you to experiment with it from inside Obsidian)
You need to know the names of the loaded icons (eg: aws-cognito, github-icon, etc) in order to use them in a mermaid block . You can list all of them with a little snippet, but the listing can be huge.
You can use those icons only as part of a architecture-beta diagram, AFAIK
Example
architecture-beta
service auth(logos:aws-cognito)[Auth]
service GH(logos:github-icon)[Git]
GH:R -- L:auth