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

doc: use custom MathJax package and config to display \longrightleftharpoons correctly #115

Merged
merged 4 commits into from
Aug 1, 2024

Conversation

pjaap
Copy link
Member

@pjaap pjaap commented Aug 1, 2024

In a discussion with @Da-Be-Ru @jpthiele we developed a hack to display the broken math symbols in the current doc in https://j-fu.github.io/VoronoiFVM.jl/dev/plutostatichtml_examples/heterogeneous-catalysis/

Pluto.jl uses a different MathJax than Documenter.jl.
Especially, we need the LaTeX package mhchem.

The solution is not intended to be final. A good solution would require to extract the MathJax package from Pluto.jl and pass this to the MathJax3 call as a url keyword.

@Da-Be-Ru
Copy link
Member

Da-Be-Ru commented Aug 1, 2024

I believe there are several ways to extract the MathJax source url used by the Pluto.jl transitive dependency in the docs environment. My understanding is that the only thing determining this is the editor.html head in the Pluto.jl frontend (the not-the-src-yet property is later copied into a src property by the invoked setup_mathjax function after an initial setup is done).

A straightfoward way to extract this URL from the docs environment is to extract the local Pluto source directory from the dependency graph and regex it out of there.

But since this is not an issue specific to VoronoiFVM.jl, I would actually suggest to escalate this functionality up to ExampleJuggler.jl which is where the @docplutonotebooks macro resides after all. Maybe this macro should already provide the proper mathengine to the Documenter.HTML call as well.

I already hacked together an example solution that could later be incorporated into ExampleJuggler.jl.
If you add me as a collaborator to your fork, @pjaap, I can demonstrate it with a commit.

@codecov-commenter
Copy link

codecov-commenter commented Aug 1, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.98%. Comparing base (b176ec7) to head (e04da4d).
Report is 79 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #115      +/-   ##
==========================================
- Coverage   85.33%   80.98%   -4.36%     
==========================================
  Files          24       24              
  Lines        2803     2913     +110     
==========================================
- Hits         2392     2359      -33     
- Misses        411      554     +143     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@j-fu
Copy link
Member

j-fu commented Aug 1, 2024

Checked locally - this works, great, thanks @pjaap .

@Da-Be-Ru : I think the PR is good enough in the moment.

ExampleJuggler has two ways of making Pluto notebooks accessible in the docs: rendered by Pluto itself in an iframe (using PlutoSliderServer.jl) or as plain HTML via PlutoStaticHTML.jl.
Extracting the mathjax version pluto to me appears to be a bit too brittle anyway.

j-fu added 3 commits August 1, 2024 22:05
We now use Catalyst.jl v14 im runtests
which requires Julia 1.10 (soon the new LTS).
The SciML ecosystem is already mostly on 1.10.
@Da-Be-Ru
Copy link
Member

Da-Be-Ru commented Aug 1, 2024

ExampleJuggler has two ways of making Pluto notebooks accessible in the docs: rendered by Pluto itself in an iframe (using PlutoSliderServer.jl) or as plain HTML via PlutoStaticHTML.jl. Extracting the mathjax version pluto to me appears to be a bit too brittle anyway.

Maybe, but I think with hard-coded URLs, this current version could just lead to similar errors depending on whatever version of Pluto the environment will resolve to and where this particular version of Pluto will get its MathJax source files from.

I tried my hand at a rough demonstration of what I mean on this fork which seems to work for me with both PlutoSliderServer.jl and PlutoStaticHTML.jl.

@j-fu j-fu merged commit 465e902 into WIAS-PDELib:master Aug 1, 2024
8 of 12 checks passed
@j-fu
Copy link
Member

j-fu commented Aug 2, 2024

Ok, we should keep this as is now and wait for JuliaDocs/Documenter.jl#2549

@pjaap
Copy link
Member Author

pjaap commented Aug 2, 2024

JuliaDocs/Documenter.jl#2549 looks like a better solution than what we did downstream here.
However, we still need to place the mhchem LaTeX package into the MathJax config. I wonder if there is a cleaner way than to overwrite the whole config.

@pjaap pjaap deleted the fix/catalyst-doc branch August 2, 2024 12:37
@j-fu
Copy link
Member

j-fu commented Aug 2, 2024

Just added this to the Documenter PR...

JuliaDocs/Documenter.jl@c17b762

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.

4 participants