Skip to content

Commit

Permalink
Merge pull request #190 from mathjax/cdn2.0
Browse files Browse the repository at this point in the history
update CDN references
  • Loading branch information
pkra committed Apr 10, 2017
2 parents 7760bfa + 9414aa2 commit 6653d77
Show file tree
Hide file tree
Showing 21 changed files with 102 additions and 156 deletions.
2 changes: 1 addition & 1 deletion _static/mathjax_mathml.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if ((window.unsafeWindow == null ? window : unsafeWindow).MathJax == null) {
(document.getElementsByTagNameNS("http://www.w3.org/1998/Math/MathML","math").length > 0))) {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full";
script.src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.0.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full";
var config = 'MathJax.Hub.Startup.onload()';
document.getElementsByTagName("head")[0].appendChild(script);
}
Expand Down
2 changes: 1 addition & 1 deletion _static/mathjax_wikipedia.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if ((window.unsafeWindow == null ? window : unsafeWindow).MathJax == null) {
//
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full";
script.src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.0.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full";
document.getElementsByTagName("head")[0].appendChild(script);
}
}
12 changes: 6 additions & 6 deletions config-files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ it via
<script type="text/javascript" src="path-to-MathJax/MathJax.js?config=default"></script>

where ``path-to-MathJax`` is the URL to the MathJax directory on your
server or hard disk. If you are using MathJax from the CDN, you can
server or hard disk. If you are using MathJax from a CDN, you can
view the contents of `default.js
<http://cdn.mathjax.org/mathjax/latest/config/default.js>`_ as a
reference, but you will not be able to edit the CDN copy. It is
possible to use the CDN copy of MathJax with your own configuration
file, however; see :ref:`Using a Local Configuration File with the CDN
<https://github.com/mathjax/MathJax/tree/master/config/default.js>`_ as a
reference, but you will not be able to edit a CDN copy. It is
possible to use a CDN copy of MathJax with your own configuration
file, however; see :ref:`Using a Local Configuration File with a CDN
<local-config-files>` for details.

The remaining files in the `MathJax/config
<http://cdn.mathjax.org/mathjax/latest/config/>`_ directory are
<https://github.com/mathjax/MathJax/tree/master/config/>`_ directory are
combined configuration files that include not just configuration
parameters but also the files that MathJax would need to load for
those configurations. This means MathJax will have to load fewer
Expand Down
103 changes: 41 additions & 62 deletions configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ section of your document:
<script type="text/javascript" src="path-to-MathJax/MathJax.js"></script>

where ``path-to-MathJax`` is replaced by the URL of the copy of MathJax
that you are loading. For example, if you are using the MathJax
that you are loading. For example, if you are using `cdnjs <https://cdnjs.com>`_ as a
distributed network service, the tag might be

.. code-block:: html

<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js">
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.0.0/MathJax.js">
</script>

If you have installed MathJax yourself, ``path-to-MathJax`` will be the
Expand Down Expand Up @@ -49,7 +49,7 @@ typical invocation of MathJax would be
.. code-block:: html

<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.0.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>

which loads MathJax with a configuration file that includes everything
Expand Down Expand Up @@ -79,70 +79,49 @@ advanced topic, however; see :ref:`Loading MathJax Dynamically

.. _loading-CDN:

Loading MathJax from the CDN
============================
Loading MathJax from a CDN
==========================

MathJax is available as a web service from ``cdn.mathjax.org``, so you
can obtain MathJax from there without needing to install it on your own
server. The CDN is part of a distributed "cloud" network, so it is
handled by servers around the world. That means that you should get access
to a server geographically near you, for a fast, reliable connection.
MathJax is available as a web service from various free CDN providers, so you
can obtain MathJax from there without needing to install it on your own
server.

The CDN hosts the most current version of MathJax, as well as older
versions, so you can either link to a version that stays up-to-date as
MathJax is improved, or you can stay with one of the release versions so
that your pages always use the same version of MathJax.
.. warning::

The URL that you use to obtain MathJax determines the version that you
get. The CDN has the following directory structure:
We retired our self-hosted CDN at `cdn.mathjax.org` in April, 2017.
We recommend using `cdnjs.com <cdnjs.com>`_ which uses the same provider.
The use of ``cdn.mathjax.org`` was governed by its `terms of service
<https://www.mathjax.org/mathjax-cdn-terms-of-service/>`_.

.. code-block:: sh
A CDN is part of a distributed "cloud" network, so it is
handled by servers around the world. That means that you should get access
to a server geographically near you, for a fast, reliable connection.

mathjax/ # project-name
1.0-latest/
1.1-latest/ # the 1.1 release with any ciritical patches
2.0-beta/ # temporary
2.0-latest/ # the 2.0 release with any ciritical patches
...
latest/ # the most current version (2.0-latest in this case)
Each directory corresponds to an official MathJax release; however,
hotfixes (urgent bug fixes) will be applied in each release branch as
necessary, even if new releases are not prepared. In other words,
``1.1-latest`` will initially point to v1.1, but over time may be updated
with patches that would correspond to releases that might be numbers 1.1a,
1.1b, etc., even if such releases are not actually packaged for
separate distribution (they likely won't be).
We may occasionally introduce directories for betas, as indicated above,
but they will be temporary, and will be removed after the official
release.

To load from a particular release, use the directory for that release.
For example,
Most CDN services offer several versions of MathJax. For example, `cdnjs`
hosts all tagged versions since v1.1 so you can link to the version
you prefer.

.. code-block:: html
.. note::

<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/1.1-latest/MathJax.js"></script>
There is currently no provider who offers a rolling release link, i.e,
a link that updates to each newer version of MathJax upon release.

will load the stable v1.1 version, even after we release v2.0 or other later
versions, while
The URL that you use to obtain MathJax determines the version that you
get. For example, `cdnjs` uses a URL that includes the version tag so
you can load the current version via

.. code-block:: html
.. code-block:: sh
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.0.0/MathJax.js # the 2.0.0 release
will always be the most current stable release, so it will go from v1.1 to
v2.0 automatically when that is released. Note that all the versions
available on the CDN are stable versions; the development version is not
hosted on the CDN. (If you wish to use the development version of
MathJax, you will need to install your own copy; see :ref:`Installing
and Testing MathJax <installation>` for information on how to do that.)
Pre-releases are also available on `cdnjs`.

The use of ``cdn.mathjax.org`` is governed by its `terms of service
<http://www.mathjax.org/download/mathjax-cdn-terms-of-service/>`_, so be
sure to read that before linking to the MathJax CDN server.
.. note::
If you wish to use the development version of
MathJax, you will need to install your own copy; see :ref:`Installing
and Testing MathJax <installation>` for information on how to do that.

If you wish to use the MathJax CDN but use your own configuration file
If you wish to use a CDN but use your own configuration file
rather than one of the pre-defined ones, see the information at the
end of the :ref:`Using a Local Configuration File
<local-config-files>` section below.
Expand Down Expand Up @@ -265,7 +244,7 @@ the ``MathJax.js`` file. For example
.. code-block:: html

<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
src="https://example.com/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>

loads the ``config/TeX-AMS-MML_HTMLorMML.js`` configuration file from the
Expand All @@ -288,22 +267,22 @@ to first load the main configuration, then the local modifications.

.. _local-config-files:

Using a local configuration file with the CDN
=============================================
Using a local configuration file with a CDN
===========================================

You can load MathJax from the MathJax CDN server but still use a
You can load MathJax from a CDN provider but still use a
configuration from your own local server. For example, suppose you
have a configuration file called ``local.js`` on your own server, in a
directory called ``MathJax/config/local``. Then you can load MathJax
from the CDN and still use your configuration file as follows:
from a CDN and still use your configuration file as follows:

.. code-block:: html

<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML,http://myserver.com/MathJax/config/local/local.js">
src="https://example.com/MathJax.js?config=TeX-AMS_HTML,http://myserver.com/MathJax/config/local/local.js">
</script>

Because the ``local.js`` file is not on the CDN server, you must give
Because the ``local.js`` file is not on a CDN server, you must give
the complete URL to the local configuration file. Note that you also
have to edit the :meth:`loadComplete()` call that is at the bottom of
the configuration file to change it from
Expand All @@ -315,7 +294,7 @@ in the ``config`` parameter. In the example above, it would be
MathJax.Ajax.loadComplete("http://myserver.com/MathJax/config/local/local.js");
That is because the ``[MathJax]`` in the original URL refers to the
root directory where ``MathJax.js`` was loaded, which is on the CDN,
root directory where ``MathJax.js`` was loaded, which is on a CDN,
not your local server, and so you need to tell MathJax the actual
location of your configuration file.

Expand Down
8 changes: 4 additions & 4 deletions dynamic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Here is an example of how to load and configure MathJax dynamically:
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
script.src = "https://example.com/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
document.getElementsByTagName("head")[0].appendChild(script);
})();
Expand All @@ -44,7 +44,7 @@ MathJax's configuration script:
head.appendChild(script);
script = document.createElement("script");
script.type = "text/javascript";
script.src = "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
script.src = "https://example.com/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
head.appendChild(script);
})();
Expand Down Expand Up @@ -106,7 +106,7 @@ IE+MathPlayer.
(document.getElementsByTagNameNS("http://www.w3.org/1998/Math/MathML","math").length > 0))) {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full";
script.src = "https://example.com/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full";
document.getElementsByTagName("head")[0].appendChild(script);
}
}
Expand Down Expand Up @@ -146,7 +146,7 @@ converting the math images to their original TeX code.
//
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full";
script.src = "https://example.com/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full";
document.getElementsByTagName("head")[0].appendChild(script);
}
}
Expand Down
2 changes: 1 addition & 1 deletion installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Installing and Testing MathJax
******************************

The easiest way to use MathJax is to link directly to the MathJax
distributed network service (see :ref:`Using the MathJax CDN
distributed network service (see :ref:`Using a CDN
<mathjax-CDN>`). In that case, there is no need to install MathJax
yourself, and you can begin using MathJax right away; skip this document on
installation and go directly to :ref:`Configuring MathJax <loading>`.
Expand Down
2 changes: 1 addition & 1 deletion jsMath.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ example,
});
</script>
<script
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
src="https://example.com/MathJax.js?config=TeX-AMS_HTML">
</script>

would load the ``jsMath2jax`` preprocessor, along with a configuration
Expand Down
2 changes: 1 addition & 1 deletion options/TeX.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ to be defined within the TeX input processor.
``false``, use the equation number.

See the `MathJax examples page
<http://cdn.mathjax.org/mathjax/latest/test/examples.html>`_ for
<https://github.com/mathjax/MathJax/blob/master/test/examples.html>`_ for
some examples of equation numbering.

.. describe:: Macros: {}
Expand Down
2 changes: 1 addition & 1 deletion output.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ native MathML support rather than HTML-CSS output for Firefox:
});
</script>
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
src="https://example.com/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>

With this configuration, MathML output will be used for both Firefox
Expand Down
2 changes: 1 addition & 1 deletion platforms/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ you.
To enable MathJax in your web platform, add the line::

<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
src="https://example.com/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

either just before the ``</head>`` tag in your theme file, or at the end of
the file if it contains no ``</head>``.
Expand Down
2 changes: 1 addition & 1 deletion platforms/movable-type.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Using MathJax in Movable Type
.. code-block:: html

<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
src="https://example.com/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>

to load MathJax from our distributed network service.
Expand Down
2 changes: 1 addition & 1 deletion platforms/wordpress.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ better choice than editing the theme directly.
.. code-block:: html

<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
src="https://example.com/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>

just before that. Otherwise, insert the same code at the very
Expand Down
4 changes: 2 additions & 2 deletions signals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ called when it arrives. For example
See the :ref:`MathJax Startup Sequence <startup-sequence>` page for
details of the messages sent during startup. See also the
`test/sample-signals.html
<http://cdn.mathjax.org/mathjax/latest/test/sample-signals.html>`_
<https://github.com/mathjax/MathJax/tree/master/test/sample-signals.html>`_
file (and its source) for examples of using signals. This example
lists all the signals that occur while MathJax is processing that
page, so it gives useful information about the details of the signals
Expand Down Expand Up @@ -157,7 +157,7 @@ signal's :meth:`Interest()` method, as in the following example.
This will cause an alert for every signal that MathJax produces. You
probably don't want to try this out, since it will produce a *lot* of
them; instead, use the `test/sample-signals.html
<http://cdn.mathjax.org/mathjax/latest/test/sample-signals.html>`_
<https://github.com/mathjax/MathJax/tree/master/test/sample-signals.html>`_
file, which displays them in the web page.

See the :ref:`Signal Object <api-signal>` reference page for details on the
Expand Down

0 comments on commit 6653d77

Please sign in to comment.