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

synchronous path #140

Closed
Pomax opened this issue Dec 29, 2015 · 2 comments
Closed

synchronous path #140

Pomax opened this issue Dec 29, 2015 · 2 comments

Comments

@Pomax
Copy link
Contributor

Pomax commented Dec 29, 2015

For the purpose of static page generation and unit testing, it would be invaluable to have a synchronous function available, rather than only having a callback available. E.g. something like:

var mathjax = require("mathjax-node/lib/mj-single");
mathjax.config({
  ...
});

...

function renderToString(latexCode) {
  return mathjax.render(latexCode);
}

...
@dpvc
Copy link
Member

dpvc commented Dec 31, 2015

Unfortunately, that is not possible with the current MathJax architecture, as that code is not atomic (i.e., it may have to wait for files to load), and so the mathjax.render() function you suggest is not currently possible without a lot of restructuring of MathJax's internals. That is not currently planned.

@pkra pkra added this to the Once upon a v3.0 milestone Feb 18, 2016
@pkra pkra added the Upstream label Feb 22, 2017
@pkra pkra removed this from the After MathJax v3.0 milestone Jan 8, 2018
@pkra
Copy link
Contributor

pkra commented Jan 8, 2018

Closing this here. MathJax v3 is synchronous and will subsume mathjax-node; cf. #375.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants