Skip to content

Commit

Permalink
Merge pull request #188 from mathjax/cdn2.5
Browse files Browse the repository at this point in the history
update CDN references
  • Loading branch information
pkra committed Apr 10, 2017
2 parents 7979207 + 62592e7 commit f4801c6
Show file tree
Hide file tree
Showing 27 changed files with 157 additions and 214 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://example.com/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://example.com/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full";
document.getElementsByTagName("head")[0].appendChild(script);
}
}
6 changes: 3 additions & 3 deletions api/localization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ locale's domains object. These store the following information:

If the domain data is stored in a separate file from the rest of
the language's data (e.g., a third-party extension that is not
stored on the CDN may have translation data that is provied by the
stored on a CDN may have translation data that is provied by the
thrid-party), this property tells where to obtain the translation
data. In the example above, the data is provided by another
company via a complete URL. The default value is the locale's
Expand All @@ -630,7 +630,7 @@ locale's domains object. These store the following information:
Registering a Translation
=========================

Typically, for languages stored on the CDN, MathJax will register the
Typically, for languages stored on a CDN, MathJax will register the
language with a call like

.. code-block:: javascript
Expand Down Expand Up @@ -714,7 +714,7 @@ extension) so that they would be obtained from the third-party server
when needed.

A third party could provide a translation for a language not covered
by the MathJax CDN by using
by a CDN by using

.. code-block:: javascript
Expand Down
10 changes: 5 additions & 5 deletions config-files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ 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/blob/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`` directory are
Expand Down
104 changes: 40 additions & 64 deletions configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ 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://example.com/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://example.com/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>

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

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
...
latest/ # the most current version (2.5-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,
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.

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/2.0-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.

loads the v2.0 version, even after v2.1 or later
versions are released, 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.5.3/MathJax.js # the 2.5.3 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
<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 @@ -268,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 @@ -291,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 server 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 @@ -318,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
10 changes: 5 additions & 5 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 @@ -81,7 +81,7 @@ Note, however, that most browsers don't allow you to insert a script
that loads a ``file://`` URL into a page that comes from the web (for
security reasons). That means that you can't have your GreaseMonkey
script load a local copy of MathJax, so you have to refer to a
server-based copy. The MathJax CDN works nicely for this.
server-based copy. a CDN works nicely for this.

----

Expand All @@ -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 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 Expand Up @@ -41,7 +41,7 @@ For previous versions, see
- `MathJax-2.0 <https://github.com/mathjax/MathJax/archive/v2.0-latest.zip>`_ (17.6MB)
- `MathJax-1.1a <https://github.com/mathjax/MathJax/archive/v1.1a.zip>`_ (15.4MB)
- `MathJax-1.1 <https://github.com/mathjax/MathJax/archive/v1.1.zip>`_ (16.4MB)
- `MathJax v1.0.1a Download Instructions <http://www.mathjax.org/download/mathjax-v1-0-1a-download-instructions/>`_.
- To install MathJax v1.0.1a, you must download two files: `MathJax-v1.0.1a.zip <https://www.mathjax.org/1.0/MathJax-v1.0.1a.zip>`__ and `MathJax-Font-Update.zip <https://www.mathjax.org/1.0/MathJax-Font-Update.zip>`__. First install the `MathJax-v1.01a.zip` distribution. Then replace the ``MathJax/fonts/HTML-CSS/TeX/otf`` directory in the resulting MathJax installation with the `otf` directory contained in the ``MathJax-Font-Update.zip`` archive.


You should download the archive of the branch corresponding to the version
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.

0 comments on commit f4801c6

Please sign in to comment.