Skip to content

Commit

Permalink
Merge pull request #183 from mathjax/cdneol
Browse files Browse the repository at this point in the history
update CDN references
  • Loading branch information
pkra committed Mar 31, 2017
2 parents 2344be6 + f28883a commit 69ac536
Show file tree
Hide file tree
Showing 20 changed files with 97 additions and 166 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.7.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.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full";
document.getElementsByTagName("head")[0].appendChild(script);
}
}
6 changes: 3 additions & 3 deletions advanced/debugging-tips.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ Using unpacked resources

MathJax provides both packged (minified) and unpacked versions of all its components. For debugging, it is useful to switch to an unpacked versions.

For example, using the MathJax CDN just add `unpacked/` before `MathJax.js`, e.g., from
For example, if your copy of MathJax lives at `https://example.com/MathJax.js` just add `unpacked/` before `MathJax.js`, e.g.,


.. code-block:: html

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

to
Expand All @@ -27,7 +27,7 @@ to
.. code-block:: html

<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/unpacked/MathJax.js?config=TeX-MML-AM_CHTML">
src="https://example.com/unpacked/MathJax.js?config=TeX-MML-AM_CHTML">
</script>


Expand Down
8 changes: 4 additions & 4 deletions advanced/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
4 changes: 2 additions & 2 deletions advanced/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
2 changes: 1 addition & 1 deletion advanced/startup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,5 @@ Extensions` will depend on the files being loaded.) Both 6 and 7 must
complete, however, before 8 will be performed.

See the `test/sample-signals.html
<http://cdn.mathjax.org/mathjax/latest/test/sample-signals.html>`_ file
<https://github.com/mathjax/MathJax/tree/master/test/sample-signals.html>`_ file
to see the signals in action.
2 changes: 1 addition & 1 deletion advanced/synchronize.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type of signal and that signal has already occurred, you will be told
about the past occurrences as well as any future ones. See the
:ref:`Signal Object <api-signal>` reference page for more details.
See also the `test/sample-signals.html
<http://cdn.mathjax.org/mathjax/latest/test/sample-signals.html>`_
<https://github.com/mathjax/MathJax/blob/master/test/sample-signals.html>`_
file in the MathJax ``test`` directory for a working example of using
signals.

Expand Down
2 changes: 1 addition & 1 deletion advanced/toMathML.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Here is a complete example:
}
);
</script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML-full"></script>
<script type="text/javascript" src="http://example.com/MathJax.js?config=TeX-AMS_HTML-full"></script>
</head>
<body>
<p>
Expand Down
6 changes: 3 additions & 3 deletions advanced/typeset.rst
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ however, that Internet Explorer does not fire the ``onchange`` event
when you press RETURN, so this example does not work as expected in
IE. A more full-featured version that addresses this problem is
available in `test/sample-dynamic.html
<http://cdn.mathjax.org/mathjax/latest/test/sample-dynamic.html>`_.
<https://github.com/mathjax/MathJax/blob/master/test/sample-dynamic.html>`_.

.. code-block:: html

Expand All @@ -205,7 +205,7 @@ available in `test/sample-dynamic.html
});
</script>
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML-full">
src="https://example.com/MathJax.js?config=TeX-AMS_HTML-full">
</script>

</head>
Expand Down Expand Up @@ -249,7 +249,7 @@ available in `test/sample-dynamic.html
</html>

There are a number of additional example pages at `test/examples.html
<http://cdn.mathjax.org/mathjax/latest/test/examples.html>`_ that
<https://github.com/mathjax/MathJax/blob/master/test/examples.html>`_ that
illustrate how to call MathJax dynamically or perform other actions
with MathJax.

Expand Down
2 changes: 1 addition & 1 deletion config-files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ it via
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
view the contents of `default.js
<http://cdn.mathjax.org/mathjax/latest/config/default.js>`_ as a
<https://github.com/mathjax/MathJax/blob/master/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
Expand Down
105 changes: 40 additions & 65 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="https://cdn.mathjax.org/mathjax/latest/MathJax.js">
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.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="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>

which loads MathJax with a configuration file that includes everything
Expand Down Expand Up @@ -79,76 +79,51 @@ 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
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 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.
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

mathjax/ # project-name
1.0-latest/
1.1-latest/ # the 1.1 release with any critical patches
2.0-latest/ # the 2.0 release with any critical patches
2.1-latest/ # the 2.1 release with any critical patches
2.2-latest/ # the 2.2 release with any critical patches
2.3-latest/ # the 2.3 release with any critical patches
2.4-latest/ # the 2.4 release with any critical patches
2.5-latest/ # the 2.5 release with any critical patches
2.6-latest/ # the 2.6 release with any critical patches
2.7-latest/ # the 2.7 release with any critical patches
...
latest/ # the most current version (2.6-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,

.. code-block:: html
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.

<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/2.0-latest/MathJax.js"></script>
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.

loads the v2.0 version, even after v2.1 or later
versions are released, while
.. note::

.. code-block:: html
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.

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:: sh
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js # the 2.7.0 release
will always be the most current stable release, so it will go from v2.3 to
the next version 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
<https://www.mathjax.org/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 @@ -225,7 +200,7 @@ the ``MathJax.js`` file. For example
.. code-block:: html

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

loads the ``config/TeX-AMS-MML_HTMLorMML.js`` configuration file from the
Expand All @@ -248,19 +223,19 @@ 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="https://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
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
4 changes: 2 additions & 2 deletions localization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ example:

.. code-block:: html

<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML&locale=fr"></script>
<script src="https://example.com/MathJax.js?config=TeX-AMS_HTML&locale=fr"></script>

will load MathJax using the French language. Users can still override
this setting using the `Language` submenu of the MathJax contextual
Expand All @@ -43,5 +43,5 @@ If you want to help in the translation process, please visit the
`TranslateWiki.net interface
<https://translatewiki.net/wiki/Translating:MathJax>`_. The page
`localization.html
<http://cdn.mathjax.org/mathjax/latest/test/localization.html>`_
<https://github.com/mathjax/MathJax/blob/master/test/localization.html>`_
is a convenient way to check the different translations.
6 changes: 1 addition & 5 deletions misc/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,7 @@ problem, please follow these steps:
problems there as well. This might help you to determine the nature
of your problem.
- If possible, check whether the problem has been solved in the latest
MathJax release. The preferred way to do this is to invoke the most
recent version of MathJax on the CDN by pointing to
https://cdn.mathjax.org/mathjax/latest/MathJax.js. If you need to work
locally, try a fresh install of the `latest
release <https://www.mathjax.org/download/>`__.
MathJax release, cf. :ref:`the installation instructions <installation>`.
- Search through the `MathJax User
Group <https://groups.google.com/group/mathjax-users>`__ to see if
anyone else has come across the problem before.
Expand Down
4 changes: 2 additions & 2 deletions misc/platforms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ you are not, you may need to have an administrator do these steps for
you. You will also have to identify the right file if the theme
consists of multiple files.

To enable MathJax in your web platform, add the line::
To enable MathJax in your web platform using cdnjs, add the line:

<script type="text/javascript"
src="httpsp://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js/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 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

0 comments on commit 69ac536

Please sign in to comment.