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

with_mermaid embedded after before_closing_body_tag #63

Closed
MarkoMin opened this issue Aug 29, 2023 · 3 comments · Fixed by #64
Closed

with_mermaid embedded after before_closing_body_tag #63

MarkoMin opened this issue Aug 29, 2023 · 3 comments · Fixed by #64

Comments

@MarkoMin
Copy link
Contributor

I have I use case where I want to use mermaid to render diagrams in docs, but I want to manipulate <svg> elements afterwards with custom javascript. When I embed mermaid script manually in before_closing_body_tag it works, but when I use with_mermaid option, graphs are renedered, but not customized via JS. Can mermaid script be executed b4 before_closing_body_tag?

I didn't dig into source, but I could come with PR if the solution is wanted.

@starbelly
Copy link
Collaborator

starbelly commented Aug 29, 2023

This was fixed up in #59 if I understand your problem correctly. Are you using the latest version of rebar3_ex_doc (v0.2.20)?

@MarkoMin
Copy link
Contributor Author

No, that issue just made the solution complete. However, imagine if you want to set all diagrams to be full-screen on click. Then, you firstly need to render them (embedded script via with_mermaid) and than you execute for loop over <svg> elements in before_closing_body_tag. However, ATM before_closing_body_tag gets executed b4 mermaid scripts so it has no effect because diagrams are not rendered yet.

@starbelly
Copy link
Collaborator

@MarkoMin I see. A PR is quite welcome.

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 a pull request may close this issue.

2 participants