jobindjohn / obsidian-publish-mkdocs

A Template to Publish Obsidian/Foam Notes on Github Pages (uses MkDocs)
Creative Commons Zero v1.0 Universal
524 stars 37 forks source link

Mermaid diagram renders in Obsidian but not in MKDocs #7

Closed virtualarchitectures closed 2 years ago

virtualarchitectures commented 2 years ago

Hi,

I've added Mermaid to the MKDocs configuration file mkdocs.yml as indicated on the material theme reference: https://squidfunk.github.io/mkdocs-material/reference/diagrams/

# Extensions
markdown_extensions:
  - footnotes
  # - attr_list
  # - pymdownx.arithmatex
  - pymdownx.superfences:
      custom_fences:
        - name: mermaid
          class: mermaid
          format: !!python/name:pymdownx.superfences.fence_code_format
  # - pymdownx.details
  # - pymdownx.magiclink
  # - pymdownx.tasklist:
  #     custom_checkbox: true
#  - pymdownx.emoji:
#      emoji_generator: !!python/name:pymdownx.emoji.to_svg
  # - admonition
  - toc:
      permalink: true

The Mermaid chart elements render in the local Obsidian instance but not on the site created with obsidian-publish-mkdocs.

Local

image

MKDocs site

image

Is there something further that need to be enabled or any changes required to the configuration for this to work?

virtualarchitectures commented 2 years ago

Apologies. I just realised that support for Mermaid.js is currently a Material for MkDocs Insiders feature and is not yet available on their main public GitHub repository: https://squidfunk.github.io/mkdocs-material/insiders/#available-features

jobindjohn commented 2 years ago

Hi @virtualarchitectures, a recent PR just handled something similar. Would you like to test it now?