Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug][Template] Possible conflict between mermaid2 plugin and integrated mermaid.js in mkdocs-materials #126

Closed
Mara-Li opened this issue Mar 26, 2023 Discussed in #125 · 1 comment
Assignees
Labels
📫 Material Mkdocs Template Discussion about the mkdocs template

Comments

@Mara-Li
Copy link
Member

Mara-Li commented Mar 26, 2023

Discussed in #125

Originally posted by h7b March 26, 2023
Hi

Since v8.2, Material for MkDocs integrates with Mermaid.js natively 1, I think we don't need to include the mermaid2 plugin.

When using both of them in the mkdocs.yml, i found that the diagram is not displayed correctly.

This is the mermaid code that I used

erDiagram
    BANKS ||--o{ PRODUCTS : has
    BANKS {
        int bank_id
        string bank_name
    }
    PRODUCTS {
        int product_id
        int loan_amount
        float interest_rate
        string accepted_risk_level
        int bank_id
        datetime created_date
    }
    CUSTOMERS ||--o{ LEADS : is
        CUSTOMERS {
        int customer_id
        string customer_name
        int customer_age
        string estimated_risk_level
        string source
        datetime created_date
    }
    PRODUCTS ||--o{ LEADS : applied_by
    LEADS {
        int customer_id
        int product_id
        datetime apply_date
    }

Here is the screencap of published page when both plugin mermaid2 and integrated mermaid.js were enabled
Screenshot 2023-03-26 040206

Next is the screencap of published page where the plugin mermaid2 is disabled
Screenshot 2023-03-26 041723

After re-verification, hope you have time to update the template

Thanks

Footnotes

  1. https://squidfunk.github.io/mkdocs-material/reference/diagrams/

@Mara-Li Mara-Li added 🐛 Bug 📫 Material Mkdocs Template Discussion about the mkdocs template labels Mar 26, 2023
@Mara-Li Mara-Li self-assigned this Mar 26, 2023
Mara-Li added a commit to Enveloppe/template-overrides that referenced this issue Mar 26, 2023
Mara-Li pushed a commit to Enveloppe/mkdocs-publisher-template that referenced this issue Mar 26, 2023
Mara-Li added a commit to Enveloppe/template-netlify-vercel that referenced this issue Mar 26, 2023
Mara-Li added a commit to Enveloppe/mkdocs-publisher-template that referenced this issue Mar 26, 2023
@Mara-Li Mara-Li closed this as completed Mar 26, 2023
@Mara-Li
Copy link
Member Author

Mara-Li commented Mar 26, 2023

To fix this on your own template :

  • Update custom-fences as here
    Aka :
  - pymdownx.superfences:
      custom_fences:
        - name: mermaid
          class: mermaid
          format: !!python/name:pymdownx.superfences.fence_code_format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📫 Material Mkdocs Template Discussion about the mkdocs template
Projects
None yet
Development

No branches or pull requests

1 participant