-
Notifications
You must be signed in to change notification settings - Fork 96
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
singleton module prevents simultaneous multiple configurations #37
Comments
Thanks for those your bug reports. Those are interesting use cases that we (obviously) had not considered (mostly because for MathJax itself cannot reconfigure all components by just changing the configuration). We're definitely open to a pull request here though the approach will probably need a bit of discussion with @dpvc (who is busy). But perhaps you can draw up something to base a discussion on? (Oh, and we'd also need a CLA eventually, see http://www.mathjax.org/cla/) |
@pkra Yep, I can open an initial PR to start discussion, though it might have to wait a day or few as I finish up some other work. I went ahead and signed the CLA. If you want to play around with it, the (very rough) prerender server I mentioned is here: https://github.com/anandthakker/prerender-mathjax . My particular reason for building it is ultimately to target PDF output (via PrinceXML) for a series of math textbooks that I'm moving to HTML. |
Thanks for signing and confirming the CLA. No rush at all; things are busy anyway. Thanks for the link! |
let me clean up and finish my PR. I will try to get to this tonight On Wed, Oct 15, 2014 at 11:32 AM, Peter Krautzberger <
|
@episodeyang are you referring to a different issue / pull request? |
No worries. I just wanted to make sure 😄 |
This bug is about |
I'm not sure what to do about this issue. It's an upstream issue and we plan to address it in MathJax v3. However, we expect MathJax v3 to run in nodejs straight away, so mathjax-node will become somewhat obsolete. Also, in my experience, the most commonly requested configuration changes (e.g., input and output options, pre-processor configurations) can be changed relatively easily, especially when re-building I'm leaning towards closing this. |
👍 I'm fine closing this, esp. given the note about MathJax v3. |
@anandthakker I'd still be curious to learn more about the configuration options that were causing issues for you. |
@pkra ack... unfortunately, the use case is long gone, and I don't actually remember the specific config options that were problematic. |
Ah, I had feared as much. Thanks for the follow up! |
The problem: there's important module-scoped variables in mj-page, making it a singleton. This makes it awkward to have multiple configurations going in the same program. And actually, because of #36, there's no clear workaround. Conversely, changing this would basically remove the need for restarting MathJax, which is what 36 is about.
Two use cases for why it would be good to have the API be "instanceable":
I'm advocating for something like:
Where
config1
andconfig2
are configuration objects in the form currently expected byconfig()
.Happy to work up a PR for this if the maintainers are in support.
The text was updated successfully, but these errors were encountered: