Update API documents to match current implementation
This commit is contained in:
parent
ae68387564
commit
846ebaa4d7
|
@ -24,7 +24,7 @@ that class.
|
||||||
Class Properties
|
Class Properties
|
||||||
================
|
================
|
||||||
|
|
||||||
.. describe:: name
|
.. describe:: id
|
||||||
|
|
||||||
The name of the jax.
|
The name of the jax.
|
||||||
|
|
||||||
|
@ -42,11 +42,13 @@ Instance Properties
|
||||||
|
|
||||||
.. describe:: inputJax
|
.. describe:: inputJax
|
||||||
|
|
||||||
A reference to the input jax that created the element.
|
A reference to the input jax that created the element. (In the
|
||||||
|
future, this will be changed to the name of the input jax.)
|
||||||
|
|
||||||
.. describe:: outputJax
|
.. describe:: outputJax
|
||||||
|
|
||||||
A reference to the output jax that has processed this element.
|
A reference to the output jax that has processed this element. (In
|
||||||
|
the future, this will be changed to the name of the output jax.)
|
||||||
|
|
||||||
.. describe:: inputID
|
.. describe:: inputID
|
||||||
|
|
||||||
|
@ -61,7 +63,8 @@ Instance Properties
|
||||||
.. describe:: originalText
|
.. describe:: originalText
|
||||||
|
|
||||||
A string indicating the original input text that was processed for
|
A string indicating the original input text that was processed for
|
||||||
this element.
|
this element. (In the future, this may be managed by the input jax
|
||||||
|
rather than ``MathJax.Hub``.)
|
||||||
|
|
||||||
.. describe:: mimeType
|
.. describe:: mimeType
|
||||||
|
|
||||||
|
|
|
@ -106,6 +106,15 @@ Methods
|
||||||
- **options** --- object containing options to be set
|
- **options** --- object containing options to be set
|
||||||
:Returns: ``null``
|
:Returns: ``null``
|
||||||
|
|
||||||
|
.. describe:: Configured()
|
||||||
|
|
||||||
|
When ``delayStartupUntil`` is specified in the configuration file or
|
||||||
|
in the script that loads ``MathJax.js``, MathJax's startup sequence is
|
||||||
|
delayed until this routine is called. See :ref:`Configuring MathJax
|
||||||
|
<configuration>` for details on how this is used.
|
||||||
|
|
||||||
|
:Returns: ``null``
|
||||||
|
|
||||||
.. describe:: Register.PreProcessor(callback)
|
.. describe:: Register.PreProcessor(callback)
|
||||||
|
|
||||||
Used by preprocessors to register themselves with MathJax so that
|
Used by preprocessors to register themselves with MathJax so that
|
||||||
|
|
|
@ -35,7 +35,7 @@ that class.
|
||||||
Properties
|
Properties
|
||||||
==========
|
==========
|
||||||
|
|
||||||
.. describe:: name
|
.. describe:: id
|
||||||
|
|
||||||
The name of the jax.
|
The name of the jax.
|
||||||
|
|
||||||
|
@ -54,15 +54,12 @@ Methods
|
||||||
.. Method:: Translate(script)
|
.. Method:: Translate(script)
|
||||||
:noindex:
|
:noindex:
|
||||||
|
|
||||||
This is the main routine called by MathJax when a ``<script>`` of
|
This is the main routine called by MathJax when a ``<script>`` of the
|
||||||
the appropriate type is found. The default :meth:`Translate()`
|
appropriate type is found. The default :meth:`Translate()` method
|
||||||
method simply loads the ``jax.js`` file and returns that callback
|
throws an error indicating that :meth:`Translate()` hasn't been
|
||||||
for that load function so that MathJax will know when to try
|
redefined, so when the ``jax.js`` file loads, it should override the
|
||||||
the :meth:`Translate()` action again. When the ``jax.js`` file
|
default :meth:`Translate()` with its own version that does the actual
|
||||||
loads, it should override the default :meth:`Translate()` with its
|
translation.
|
||||||
own version that does the actual translation; that way, when the
|
|
||||||
second Translate call is made, it will be to the actual
|
|
||||||
translation routine rather than the default loader.
|
|
||||||
|
|
||||||
The translation process should include the creation of an
|
The translation process should include the creation of an
|
||||||
:ref:`Element Jax <api-element-jax>` that stores the data needed
|
:ref:`Element Jax <api-element-jax>` that stores the data needed
|
||||||
|
@ -84,3 +81,4 @@ Methods
|
||||||
:Parameters:
|
:Parameters:
|
||||||
- **mimetype** --- the MIME-type of the input this jax processes
|
- **mimetype** --- the MIME-type of the input this jax processes
|
||||||
:Returns: ``null``
|
:Returns: ``null``
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ Unlike most MathJax.Object classes, calling the class object creates a
|
||||||
.. code-block:: javascript
|
.. code-block:: javascript
|
||||||
|
|
||||||
MathJax.InputJax.MyInputJax = MathJax.InputJax({
|
MathJax.InputJax.MyInputJax = MathJax.InputJax({
|
||||||
name: "MyInputJax",
|
id: "MyInputJax",
|
||||||
version: "1.0",
|
version: "1.0",
|
||||||
...
|
...
|
||||||
});
|
});
|
||||||
|
@ -40,7 +40,7 @@ Class Properties
|
||||||
Instance Properties
|
Instance Properties
|
||||||
===================
|
===================
|
||||||
|
|
||||||
.. describe:: name
|
.. describe:: id
|
||||||
|
|
||||||
The name of the jax.
|
The name of the jax.
|
||||||
|
|
||||||
|
@ -67,35 +67,40 @@ Instance Properties
|
||||||
Methods
|
Methods
|
||||||
=======
|
=======
|
||||||
|
|
||||||
.. Method:: Translate(script)
|
.. Method:: Process(script)
|
||||||
|
|
||||||
This is the method that the ``MathJax.Hub`` calls when it needs
|
This is the method that the ``MathJax.Hub`` calls when it needs the
|
||||||
the input or output jax to process the given math ``<script>``
|
input or output jax to process the given math ``<script>``. Its
|
||||||
call. Its default action is to start loading the jax's ``jax.js``
|
default action is to start loading the jax's ``jax.js`` file, and
|
||||||
file, and redefine the :meth:`Translate()` method to be the
|
redefine itself to simplu return the callback for the laod operation
|
||||||
:meth:`noTranslate()` method below. The ``jax.js`` file should
|
(so that further calls to it will cause the processing to wait for the
|
||||||
redefine the :meth:`Translate()` method to perform the translation
|
callback). Once the ``jax.js`` file has loaded, this method is
|
||||||
operation for the specific jax. For an input jax, it should
|
replaced by the jax's :meth:`Translate()` method, so that subsequent calls
|
||||||
return the `ElementJax` object that it created.
|
to :meth:`Process()` will perform the appropriate translation.
|
||||||
|
|
||||||
:Parameters:
|
:Parameters:
|
||||||
- **script** --- reference to the DOM ``<script>`` object for
|
- **script** --- reference to the DOM ``<script>`` object for
|
||||||
the mathematics to be translated
|
the mathematics to be translated
|
||||||
:Returns: an `ElementJax` object, or ``null``
|
:Returns: an `ElementJax` object, or ``null``
|
||||||
|
|
||||||
.. Method:: noTranslate(script)
|
.. Method:: Translate(script)
|
||||||
|
|
||||||
This is a temporary routine that is used while the ``jax.js`` file
|
This is a stub for a routine that should be defined by the jax's
|
||||||
is loading. It throws an error indicating the the
|
``jax.js`` file when it is loaded. It should perform the translation
|
||||||
:meth:`Translate()` method hasn't been redefined. That way, if
|
action for the specific jax. For an input jax, it should return the
|
||||||
the ``jax.js`` file failes to load for some reason, you will
|
`ElementJax` object that it created. The :meth:`Translate()` mehtod is
|
||||||
receive an error trying to process mathematics with this input
|
never called directly by MathJax; during the :meth:`loadComplete()`
|
||||||
jax.
|
call, this funciton is copied to the :meth:`Process()` method, and is
|
||||||
|
called via that name. The default :meth:`Translate()` method throws an
|
||||||
|
error indicating that the :meth:`Translate()` meth was not been
|
||||||
|
redefined. That way, if the ``jax.js`` file fails to load for some
|
||||||
|
reason, you will receive an error trying to process mathematics with
|
||||||
|
this jax.
|
||||||
|
|
||||||
:Parameters:
|
:Parameters:
|
||||||
- **script** --- reference to the DOM ``<script>`` object for
|
- **script** --- reference to the DOM ``<script>`` object for
|
||||||
the mathematics to be translated
|
the mathematics to be translated
|
||||||
:Returns: ``null``
|
:Returns: an `ElementJax` object, or ``null``
|
||||||
|
|
||||||
.. Method:: Register(mimetype)
|
.. Method:: Register(mimetype)
|
||||||
|
|
||||||
|
@ -136,13 +141,16 @@ Methods
|
||||||
1. Post the "[name] Jax Config" message to the startup signal.
|
1. Post the "[name] Jax Config" message to the startup signal.
|
||||||
2. Perform the jax's :meth:`Config()` method.
|
2. Perform the jax's :meth:`Config()` method.
|
||||||
3. Post the "[name] Jax Require" message to the startup signal.
|
3. Post the "[name] Jax Require" message to the startup signal.
|
||||||
4. Load the files from the jax's ``require`` array (which may
|
4. Load the files from the jax's ``require`` and
|
||||||
have been modified during the configuration process).
|
``config.extensions`` arrays.
|
||||||
5. Post the "[name] Jax Startup" message to the startup signal.
|
5. Post the "[name] Jax Startup" message to the startup signal.
|
||||||
6. Perform the jax's :meth:`Startup()` method.
|
6. Perform the jax's :meth:`Startup()` method.
|
||||||
7. Post the "[name] Jax Ready" message to the startup signal.
|
7. Post the "[name] Jax Ready" message to the startup signal.
|
||||||
8. perform the :meth:`MathJax.Ajax.loadComplete()` call for the
|
8. perform the :meth:`MathJax.Ajax.loadComplete()` call for the
|
||||||
``jax.js`` file.
|
``jax.js`` file.
|
||||||
|
|
||||||
|
Note that the configuration process (the :meth:`Config()` call) can
|
||||||
|
modify the ``require`` or ``config.extensions`` arrays to add more
|
||||||
|
files that need to be loaded, and that the :meth:`Startup()` method
|
||||||
|
isn't called until those files are completely loaded.
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ that class.
|
||||||
Properties
|
Properties
|
||||||
==========
|
==========
|
||||||
|
|
||||||
.. describe:: name
|
.. describe:: id
|
||||||
|
|
||||||
The name of the jax.
|
The name of the jax.
|
||||||
|
|
||||||
|
@ -57,16 +57,13 @@ Methods
|
||||||
|
|
||||||
This is the main routine called by MathJax when an element jax is
|
This is the main routine called by MathJax when an element jax is
|
||||||
to be converted to output. The default :meth:`Translate()`
|
to be converted to output. The default :meth:`Translate()`
|
||||||
method simply loads the ``jax.js`` file and returns that callback
|
method throws an error indicating that :meth:`Translate()` hasn't been
|
||||||
for that load function so that MathJax will know when to try
|
redefined, so when the ``jax.js`` file loads, it should override the
|
||||||
the :meth:`Translate()` action again. When the ``jax.js`` file
|
default :meth:`Translate()` with its own version that does the actual
|
||||||
loads, it should override the default :meth:`Translate()` with its
|
translation.
|
||||||
own version that does the actual translation; that way, when the
|
|
||||||
second Translate call is made, it will be to the actual
|
|
||||||
translation routine rather than the default loader.
|
|
||||||
|
|
||||||
You should use ``MathJax.Hub.getJaxFor(script)`` to obtain the
|
You should use ``MathJax.Hub.getJaxFor(script)`` to obtain the
|
||||||
element jax for the given script. The translation process may add
|
element jax for the given script. The translation process may
|
||||||
modify the element jax (e.g., if it has data that needs to be
|
modify the element jax (e.g., if it has data that needs to be
|
||||||
stored with the jax), and may insert DOM elements into the
|
stored with the jax), and may insert DOM elements into the
|
||||||
document near the jax's ``<script>`` tag.
|
document near the jax's ``<script>`` tag.
|
||||||
|
|
|
@ -40,7 +40,7 @@ Issue tracking
|
||||||
==============
|
==============
|
||||||
|
|
||||||
Found a bug or want to suggest an improvement? Post it to our `issue tracker
|
Found a bug or want to suggest an improvement? Post it to our `issue tracker
|
||||||
<http://github.com/mathjax/mathjax/issues>`_. We monitor the tracker closely,
|
<http://github.com/mathjax/MathJax/issues>`_. We monitor the tracker closely,
|
||||||
and work hard to respond to problems quickly.
|
and work hard to respond to problems quickly.
|
||||||
|
|
||||||
Before you create a new issue, however, please search the issues to see if it
|
Before you create a new issue, however, please search the issues to see if it
|
||||||
|
|
|
@ -50,6 +50,8 @@ and it also avoids the conflict between the use of the less-than sign,
|
||||||
an HTML tag).
|
an HTML tag).
|
||||||
|
|
||||||
|
|
||||||
|
.. _mathjax-script-tags:
|
||||||
|
|
||||||
How mathematics is stored in the page
|
How mathematics is stored in the page
|
||||||
=====================================
|
=====================================
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user