jelly-beam / rebar3_ex_doc

rebar3 plugin for generating docs with ex_doc
Apache License 2.0
43 stars 13 forks source link

Fix rendering issues when mermaid is used #59

Closed weiss closed 1 year ago

weiss commented 1 year ago

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.

starbelly commented 1 year ago

@weiss This makes sense to me. Thank you!