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

docs: include mermaid.js library #569

Closed
wants to merge 2 commits into from

Conversation

lewismiddleton
Copy link
Contributor

Adds the minified mermaid.js library to the mkdocs extra_javascript.

Inspired by a comment on the original feature request at mkdocs-material for mermaid support.

Using the extra_javascript feature to include the minified mermaid.js library from https://unpkg.com/browse/[email protected]/dist/

Resolves: #567

Adds the minified mermaid.js library to the mkdocs
`extra_javascript`.
@lewismiddleton lewismiddleton requested a review from a team as a code owner April 3, 2024 07:49
@lewismiddleton lewismiddleton changed the title add extra_javascript docs: include mermaid.js library Apr 3, 2024
@lewismiddleton
Copy link
Contributor Author

lewismiddleton commented Apr 3, 2024

Here are some findings from my testing:

markdown_extensions:
  - pymdownx.superfences:
      custom_fences:
        - name: mermaid
          class: mermaid
          format: !!python/name:pymdownx.superfences.fence_div_format
          # Doesn't work
          # format: !!python/name:pymdownx.superfences.fence_code_format

extra_javascript:
  - https://unpkg.com/[email protected]/dist/mermaid.min.js
 
# Doesn't change behaviour
# extra_css:
#   - https://unpkg.com/[email protected]/dist/mermaid.css
  

Comment on lines +70 to +72

extra_javascript:
- https://unpkg.com/[email protected]/dist/mermaid.min.js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad I missed this PR when reviewing #568.

But as I was mentioning in my comment, I believe I was able to get those mermaid graph rendered without the need of specifying those extra settings.

Suggested change
extra_javascript:
- https://unpkg.com/[email protected]/dist/mermaid.min.js

Give it another try and let me know if it's working for you.

@lewismiddleton lewismiddleton deleted the mermaid-extra-js branch September 23, 2024 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docs: mermaid diagrams don't render
2 participants