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.

Admonition: side effect of collapsed note with mermaid2 diagram

See original GitHub issue

Note: Sorry for the misfiling, as it is only a cross referenced issue on fralau/mkdocs-mermaid2-plugin#8 . I would not want to call it a bug and the problem is in a customization (plugin). Actually, it’s one heck of a boundary case, but it might be interesting because of what we could learn from it 😄.

Material is becoming more or less a de facto standard with mkdocs. Perhaps we would need a specific category for these inevitable INTERACTION issues between material and other downstream extensions and plugins, i.e. where it is not at a question of any “bug” on either side, but rather to coordinate our efforts in order to improve interoperability? This might also be an opportunity to attract good will people with a wide range of skill sets?

Here is the short description: the combination of Adminition collapsible notes + mermaid2 diagram does work, while collapsed notes + mermaid2 diagram does not work.

???+ note "Collapsable but open"
    ```mermaid
    graph TD
    A[Client] --> B[Load Balancer]
    ```
??? note "Collapsed"
    ```mermaid
    graph TD
    A[Client] --> B[Load Balancer]
    ```

According to tests performed by the person who reported the issue, the html page served by mkdocs serve differs in heigh and viewbox between the “collapsible” and “collasped cases”.

-    <details class="note" open="open">
?                                ----
+     <details class="note" open="">
? +
-         <summary>Collapsable but open</summary>
?                         --- ^^^^^^^^^
+         <summary>Collapsed</summary>
?                          ^
-         <div class="mermaid" data-processed="true"><svg id="mermaid-159781860xxxx" width="187.546875"
?                                                                                            ----- ---
+         <div class="mermaid" data-processed="true"><svg id="mermaid-159781860xxxx" width="16"
-                 xmlns="http://www.w3.org/2000/svg" height="181" viewBox="0 0 187.546875 181">
?                                                             ^^           ^^^  ----- ---  ^^
+                 xmlns="http://www.w3.org/2000/svg" height="16" viewBox="-8 -8 16 16">
?                                                             ^           ^^^^^     ^

Though I am a little out of my depth here, it intuitively makes sense. My working hypothesis is that when the user is trying to “uncollapse” the note in the browser, something should happen also to the diagram that is inside, which is not happening.

The code of the mermaid2 plugin does not interfere with those CSS parameters. My previous experience (with SuperFences) is, however, that a tweak is sometimes neeeded in the plugin so that it correctly catches the ball.

If you have any hints, thoughts or comments, let me know? A lot of more information is available on: fralau/mkdocs-mermaid2-plugin#8

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:32 (25 by maintainers)

github_iconTop GitHub Comments

2reactions
squidfunkcommented, Jan 1, 2021

I just bumped into another reason why a native and deep integration makes sense - I now have it successfully running with instant loading and without the need for any config or extra JS. When there’s a mermaid block in the source, the theme will automatically inject the necessary JavaScript and set Mermaid up itself 😊

2reactions
squidfunkcommented, Dec 31, 2020

I’ve been playing around with Mermaid and finally have a good proof of concept for an integration which works in conjunction with the mkdocs-minify-plugin and will adjust to the chosen color palette, including dark mode:

Ohne Titel

It doesn’t use any plugins besides Superfences and will be activated just by including the Mermaid JavaScript. No configuration required albeit overrides will be possible.

My testing shows that this does also solve the original issue (not working as part of details).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Martin Donath on Twitter: "@NiklasBegley @sellorm Native Mermaid ...
It comes with Mermaid JS diagram support, full text search, ... Admonition: side effect of collapsed note with mermaid2 diagram · Issue #1875...
Read more >
Admonitions - Material for MkDocs
Admonitions, also known as call-outs, are an excellent choice for including side content without significantly interrupting the document flow.
Read more >
Material for MkDocs - GitHub
Fixed #7: Better colors for links inside admonition notes and warnings ... extension for a specific page, which has the nice side effect...
Read more >
Untitled
Qualstar passport, Felica brown, Samsung galaxy note 4 tutorials, Michael berenbaum a mosaic ... Side effect of supplement bodybuilding, Zagreb kino europa, ...
Read more >
Life and Letters Of Robert Browning - PinkMonkey.com
Our poet sprang, on the father's side, from an obscure or, as family tradition asserts, ... to some notes made for the Browning...
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