mkdocs-material icon indicating copy to clipboard operation
mkdocs-material copied to clipboard

feat: add ability to control mermaid icon packs

Open kirillmakhonin-brt opened this issue 11 months ago • 5 comments

About

This pull request adds an ability to control mermaid JS, particulary:

  1. Load additional icon packs
  2. Control version of Mermaid JS library

Checklist

  • [x] Documentation
  • [x] Example
  • [x] JSON Schema

kirillmakhonin-brt avatar Jan 22 '25 21:01 kirillmakhonin-brt

Thanks for the PR. We are currently in feature freeze, because we're putting all of our efforts into very important foundational work. Once that's done, we might consider adding this functionality.

squidfunk avatar Jan 23 '25 01:01 squidfunk

shahida

shahida615 avatar Jan 30 '25 18:01 shahida615

+1 for this feature

nice icons are missing and can only be added via a library

egandro avatar Feb 07 '25 20:02 egandro

Please use reactions on the original post. Do not +1, as it only adds noise.

squidfunk avatar Feb 08 '25 01:02 squidfunk

I was missing this feature, thanks a lot!

I have two suggestions:

  • Parameter names should have consistent cases: every parameters are in snake_case. Wouldn't be better practice to keep it that way?
  • I find very confusing the way logo groups are configured. iconnify:logo@1 or url:aws:... does not provide a clear view on how to refer to the group in the diagrams, nor how to configure it.

Regarding this last point, my idea would be to explicitly make the user specify the name and the type of the target. Here's an idea on what the configuration could look like:

theme:
  mermaid:
    icon_packs:
      logos:
        type: iconify
        path: logos@1
      aws:
        type: url
        url:  https://raw.githubusercontent.com/awslabs/aws-icons-for-plantuml/v19.0

Using a dict instead of a list:

  • ensures the uniqueness of the logo group name
  • ensures the clarity of the group name and how to use it in the documentation's diagrams
  • allow the user to use a custom name that fit is needs (enterprise conventions or else)

Explicit type clarify the documentation, Mkdocs Material could have a small paragraph dedicated to each type and how to configure it.

robinlioret avatar Feb 16 '25 09:02 robinlioret

@squidfunk could you please tell if this project is still in the feature freeze? I'm ready to update PR once you can confirm that you're ready to accept changes. This feature is popular within our company and it looks like community also has an interest, so we would like to help.

kirillmakhonin-brt avatar Jun 25 '25 21:06 kirillmakhonin-brt

Thanks again for the PR and the time you invested. We added the ability to load a custom version of Mermaid 3 weeks ago (also documented here), which will allow you to customize the Mermaid.js integration as you need. We won't deepen our integration, since the API has proven to be too unstable in the past, which is why customization is the way to go ☺️

squidfunk avatar Aug 22 '25 08:08 squidfunk