-
-
Notifications
You must be signed in to change notification settings - Fork 92
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
resolves #207 create a browser-compatible version of the Document converter #228
base: main
Are you sure you want to change the base?
Conversation
f9e8e75
to
9c0050c
Compare
…verter - Reduce the scope of the classes - Use browserify to produce a browser-compatible file - Inline files content (ie. replace readFileSync) to bundle everything into a single JavaScript file - Add tests
9c0050c
to
9b340cd
Compare
Currently, MathJax is not self-contained and tries to load JavaScript files and fonts from a path/URL. Alternatively, we could create a browser-compatible version of the Asciidoctor MathJax extension: https://gitlab.com/djencks/asciidoctor-mathjax.js/-/tree/master I did try to use an SVG output (instead of the CommonHTML output) but it does not look so great on the PDF. One advantage of the SVG output is that it is relatively self-contained (i.e. it does not rely heavily on fonts). One disadvantage is that there's no character so the expression cannot be copy and pasted. I'm seriously considering dropping MathJax in favor of KaTeX. MathJax is great but, in my opinion, does too much. In comparison, here's how to integrate KaTeX in the browser: https://katex.org/docs/browser.html Since KaTeX does not load additional modules or components, it's straightforward to bundle the library. |
Blocked by #316 |
@Mogztter - for what it is worth: I managed to package a self-contained version of MathJax 2.x for the AsciiDoc plugin for IntelliJ. You find the result here: https://github.com/asciidoctor/asciidoctor-intellij-plugin/tree/master/src/main/resources/org/asciidoc/intellij/editor/javafx/MathJax As asciidoctor-web-pdf is already using 3.x, am I correct that this doesn't help here? |
@Mogztter - sorry, just saw the other issue; please disregard my comment. |
No worries, I guess a self-contained version of MathJax 3.x will be useful in the Asciidoctor ecosystem but I didn't figure out (yet) how the build/require/module system in MathJax 3.x is working. I've created mathjax/MathJax#2539 which potentially could solve the main issue (i.e. disable dynamic font loading). |
resolves #207