elixir-lang / ex_doc

ExDoc produces HTML and EPUB documentation for Elixir projects
http://elixir-lang.org
Other
1.44k stars 324 forks source link

Sidebar missing until mermaidjs finishes loading #1941

Open vlad-ngn opened 1 month ago

vlad-ngn commented 1 month ago

Hi!

Previous discussion: https://github.com/erlang/erlang-org/issues/150

Screenshot 1: Sidebar missing, mermaidjs loading

Screenshot from 2024-08-12 18-28-14

Screenshot 2: Sidebar appeared after mermaidjs loaded

Screenshot from 2024-08-12 18-28-45

This is a problem for me, because mermaidjs takes ~ 1 minute to load.

Browser: Google Chrome Version 126.0.6478.126 (Official Build) (64-bit)

@Benjamin-Philip

voughtdq commented 1 month ago

Not a browser expert, but I think the problem here might be that because html.js is loaded async, but mermaid isn't, the sidebar loads after mermaid.

Maybe changing the mermaid script to async will fix it 🤔

voughtdq commented 1 month ago

Actually, ExDoc is also the wrong place to submit this issue too. I'm researching how to fix the problem, but the Mermaid scripts are installed here: https://github.com/erlang/otp/blob/OTP-27.0.1/make/ex_doc.exs#L190

josevalim commented 1 month ago

Thank you @voughtdq! Can you also please send a PR updating the examples here? https://github.com/elixir-lang/ex_doc?tab=readme-ov-file#extensions

Benjamin-Philip commented 1 month ago

I'll patch the Erlang docs. Thanks @voughtdq.