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

third-party path variable #737

Closed
pkra opened this issue Feb 12, 2014 · 18 comments

Comments

Projects
None yet
2 participants
@pkra
Copy link
Member

commented Feb 12, 2014

For third-party extensions and configurations, it would be useful to be able to set a custom path variable (like [MathJax]).

dpvc pushed a commit to dpvc/MathJax that referenced this issue Mar 18, 2014

@dpvc dpvc modified the milestone: Bugfix Version Mar 18, 2014

@dpvc

This comment has been minimized.

Copy link
Member

commented Mar 18, 2014

I've added the ability to specify additional root paths (or redirect the MathJax path). Use

<script type="text/x-mathjax-config">
MathJax.Ajax.config.path["Extra"] = "http://my.extra.com/mathjax/extra";
</script>

to add "[Extra]" as a prefix that points to http://my.extra.com/mathjax/extra so that

MathJax.Hub.Config({
  extensions: ["[Extra]/spiffy.js"]
});

would load the spiffy extension from the URL listed above.

So if you wanted to have a "contrib" repository served from the CDN, you could use something like

MathJax.Ajax.config.path["Contrib"] = "http://cdn.mathjax.org/contrib";

and then

MathJax.Hub.Config({
  extensions: ["[Contrib]/knowl/knowl.js"]
});

to load the knowl extension (assuming that's where it was located). You could also have versioned subdirectories, e.g., [Contrib]/knowl/1.0/knowl.js or whatever. We could have the contrib path set up automatically, just like [MathJax].

@dpvc

This comment has been minimized.

Copy link
Member

commented Mar 18, 2014

Not sure if this is for the next release, or for a later one, however.

@dpvc dpvc added this to the Bugfix Version milestone Mar 19, 2014

@dpvc dpvc added Merged and removed Ready for Review labels Mar 20, 2014

@dpvc

This comment has been minimized.

Copy link
Member

commented Mar 20, 2014

=> Merged

@dpvc dpvc closed this Mar 20, 2014

@dpvc

This comment has been minimized.

Copy link
Member

commented Apr 22, 2014

We've decided not to pre-define the [Contrib] path, so page authors will have to request that themselves if they want to use it.

dpvc pushed a commit to mathjax/MathJax-test that referenced this issue Apr 22, 2014

@dpvc

This comment has been minimized.

Copy link
Member

commented Apr 22, 2014

=> In Test Suite

API/Ajax/Load-3.html

@pkra

This comment has been minimized.

Copy link
Member Author

commented May 5, 2014

Quick question. For the loadComplete call something like MathJax.Ajax.loadComplete("[Extra]/mypath/myextension.js"); is the right way, correct?

@dpvc

This comment has been minimized.

Copy link
Member

commented May 5, 2014

Yes. We had talked about [Contrib] rather than [Extra], but that is the right idea.

@pkra

This comment has been minimized.

Copy link
Member Author

commented May 5, 2014

Right. I was going for [contrib]. Do you prefer [Contrib]?

@dpvc

This comment has been minimized.

Copy link
Member

commented May 5, 2014

It doesn't matter to me. For some reason I like the capitalization better, but there is no real reason for that, so whatever you want to use is fine.

@pkra

This comment has been minimized.

Copy link
Member Author

commented May 5, 2014

[Contrib] it is.

@pkra

This comment has been minimized.

Copy link
Member Author

commented Jun 10, 2014

What should the path on the CDN be? cdn.mathjax.org/mathjax/contrib?

@dpvc

This comment has been minimized.

Copy link
Member

commented Jun 10, 2014

Sounds right.

@pkra

This comment has been minimized.

Copy link
Member Author

commented Jun 10, 2014

Done.

@pkra

This comment has been minimized.

Copy link
Member Author

commented Jun 12, 2014

For the documentation, what's the "JS equivalent" of

<script type="text/x-mathjax-config">
    MathJax.Ajax.config.path["Extra"] = "http://my.extra.com/mathjax/extra";
</script>

by which I mean the new inline configuration way since 2.3, e.g., something like

<script type="text/javascript">
  window.MathJax = {
      ... initialization code ...
    }
  };
</script>
@dpvc

This comment has been minimized.

Copy link
Member

commented Jun 12, 2014

<script type="text/javascript">
  var MathJax = {
    AuthorInit: function () {
      MathJax.Ajax.config.path["Extra"] = "http://my.extra.com/mathjax/extra";
    }
  }
</script>
@pkra

This comment has been minimized.

Copy link
Member Author

commented Jun 12, 2014

Huh?

@dpvc

This comment has been minimized.

Copy link
Member

commented Jun 12, 2014

Hit RETURN accidentally. I've edited the comment.

@pkra

This comment has been minimized.

Copy link
Member Author

commented Jun 12, 2014

Thanks!

@dpvc dpvc added v2.4 and removed Merged labels Jun 30, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.