question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

no <script> mermaid.initialize(...) </script> in generated pages

See original GitHub issue

I just now installed the plugin to MkDocs using pip, so I’m assuming I’m using the latest version.

When starting MkDocs serve, I can see that MERMAID2 is reading my configuration and parsing things like initialization arguments. However. the generated page does not contain:

<script>
mermaid.initialize(...)
</script>

I don’t think i’m doing anything wrong…

My mkdocs.yml

site_name: x
nav: 
  - Home: 
theme: material
plugins:
  - search
  - mermaid2:
      arguments:
        theme: 'dark'
extra_javascript:
  - https://unpkg.com/mermaid@8.7.0/dist/mermaid.min.js

I added the theme dark there to see whether it would trigger the generationg of mermaid.initialize(). Also I tried the exact version of the mermaid.js that was mentioned in the installation documentatoin.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
nschootcommented, Dec 16, 2020

This “solved” it for me.

Changed file “plugin.py”, line 168

            pre_code_tags = soup.select("pre code.language-mermaid")

Obvious question is of course, why did it use class “language-mermaid”…

0reactions
fralaucommented, Dec 16, 2020

@nschoot Thanks a lot for your research and for finding the source !

I published the new version on pypi.

Read more comments on GitHub >

github_iconTop Results From Across the Web

mermaid - Generation of diagrams and flowcharts from text in ...
This is why mermaid was born, a simple markdown-like script language for generating charts from text via javascript. Try it using our editor....
Read more >
Embed Mermaid in Jekyll without plugin - JackGruber
Mermaid is a simple markdown-like script language for generating charts ... plugin in your Jekyll blog/site which is useful for Github pages.
Read more >
Rendering Mermaid Charts - Markdown Monster Documentation
If you're pasting a mermaid chart for the very first time into a document, the chart won't render because the associated script is...
Read more >
How to make GitHub Pages Markdown support mermaid ...
I found the solution. <!DOCTYPE html> <html lang="en"> <head> <script ...
Read more >
Diagrams | Hugo
Hugo currently does not provide default templates for Mermaid diagrams. ... <script> mermaid.initialize({ startOnLoad: true }); </script> {{ end }}.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found