-
Notifications
You must be signed in to change notification settings - Fork 37
add mermaid.js and mathjax to npm deps #231
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
Conversation
|
I think rather than download mermaid.js when the docs are built, we could just add it as a dependency to |
|
I had considered that as well, but I wasn't sure if changing the package.json was a welcome change. I'll rework this and get back to you... I'm still not convinced that the mathjax lib needs to be handled by this theme. Sphinx' |
|
It is true that mathjax isn't really related to this theme. Perhaps it would be better if Sphinx itself included a version of mathjax so that there is no dependency on external resources by default. But I'm not sure how likely that is to go through... Particularly since we may soon provide a way to use mathml instead, I think it is reasonable to just ignore mathjax for now... But in general providing a way to avoid any dependence on external resources is a useful feature, and one that can be a bit annoying for users to implement themselves. |
Oh, you're focused on the default behavior. 🤦🏼 That would be so easy to just change the default value of |
src/assets/javascripts/components/content/code/mermaid/index.ts
Outdated
Show resolved
Hide resolved
d5f38b8 to
19cc0ab
Compare
src/assets/javascripts/components/content/code/mermaid/index.ts
Outdated
Show resolved
Hide resolved
f1d18e7 to
7ae47f8
Compare
|
Regarding mathjax, now that all major browsers support MathML, it may make sense to explore whether we can just recommend using mathml instead of mathjax, since if it works, it would require no additional libraries and would render without a delay. This comment describes how it might simply require modifying the docutils.conf file in the doc root directory: sphinx-doc/sphinx#6092 (comment) Not sure if anyone has actually tested that, though. |
|
I was going to approach the #233 separately. The newer MathML feature does look much more appealing, but this work is more like retrofitting when it comes to mathjax use. The sphinx dev cycle isn't too slow (for the most part), so hopefully there will be more development/testing with MathML in Sphinx by the time we get around to #233 . |
1270b3b to
def49f1
Compare
|
Can you also ensure that the licenses for these two packages are added to the generated license file (see |
The mermaid dist includes a copy of the License alongside the mermaid.min.js* files. Did you want to keep that in the bundles folder as well? Or is it sufficient to have it only in the generated LICENSE file? |
Keeping a copy of the license there as well makes sense. |
- mermaid dist is copied to built docs' static files. - mathjax dist is copied to built docs' static files if the sphinx.ext.mathjax is enabled. mathjax script tag attributes intentionally exclude async.
remove unneeded path delimiter
keep mathjax dist in its own static folder
also keep mermaid dist in its own static folder
jbms
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
mathjax script tag attributes intentionally exclude async.
resolves #150