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 #68 by setting mermaid init JS priority #77

Merged
merged 1 commit into from
Nov 4, 2021

Conversation

florianhumblot
Copy link
Contributor

If the js script is local, the initialization code is inserted before the actual mermaid.(min.)js include which makes the init script error with mermaid is undefined.
According to: https://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx.add_js_file
The default prioirty for app.add_js_file is 500, while the default priority of html_js_files is 800.

A different solution would be to pass the path to the local mermaid.js to this plugin and have it insert it at the right time but I am not familiar enough with this code base to make that change

If the js script is local, the initialization code is inserted before the actual `mermaid.(min.)js` include which makes the init script error with `mermaid is undefined`.
According to: https://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx.add_js_file
The default prioirty for `app.add_js_file` is 500, while the default priority of `html_js_files` is 800. 

A different solution would be to pass the path to the local mermaid.js to this plugin and have it insert it at the right time but I am not familiar enough with this code base to make that change
@mgaitan mgaitan merged commit a6c1f8b into mgaitan:master Nov 4, 2021
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.

None yet

2 participants