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

Fix rendering issues when mermaid is used #59

Merged
merged 1 commit into from
Aug 15, 2023

Conversation

weiss
Copy link
Contributor

@weiss weiss commented Aug 7, 2023

When mermaid support is enabled, also inject the code snippet suggested in the ExDoc README (into the HTML <body/> rather than the <head/>). This resolves rendering issues such as the menu not being displayed properly. See, for example:

https://eturnal.net/tmp/rendering-broken/

When I access that page (on desktop), the menu items on the left aren't displayed (until I press PAGES/MODULES). This happens on pages without mermaid diagrams as well.

With this PR applied, things appear to be rendered fine:

https://eturnal.net/tmp/rendering-fixed/

I must admit that I'm not a web dev and am not entirely sure regarding the details here. However, I figured that following the 'official' ExDoc advice seems fine if it resolves issues.

When mermaid support is enabled, inject the code snippet suggested here
(into the HTML <body/> rather than the <head/>):

https://github.com/elixir-lang/ex_doc/blob/v0.30.4/README.md#rendering-mermaid-graphs

This resolves rendering issues such as the menu not being displayed
properly.
@starbelly
Copy link
Collaborator

@weiss This makes sense to me. Thank you!

@starbelly starbelly merged commit 4266102 into jelly-beam:main Aug 15, 2023
1 check passed
@weiss weiss deleted the bugfix/mermaid-rendering branch August 15, 2023 04:28
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.

2 participants