Skip to content

Commit 4b29b9a

Browse files
authored
Merge pull request #384 from mathjax/issue383
Update README and bump version. #383
2 parents 89d1e0a + 911da74 commit 4b29b9a

File tree

2 files changed

+44
-33
lines changed

2 files changed

+44
-33
lines changed

README.md

Lines changed: 43 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# mathjax-node [![Build Status](https://travis-ci.org/mathjax/MathJax-node.svg?branch=develop)](https://travis-ci.org/mathjax/MathJax-node)
22

3-
This repository contains a library that provides an API to call [MathJax](https://github.com/mathjax/mathjax) from Node.js programs. The API converts individual math expressions (in any of MathJax's input formats) into HTML (with CSS), SVG or MathML code.
3+
This repository contains a library that provides an API to call [MathJax](https://github.com/mathjax/mathjax) from Node.js programs. The API converts individual math expressions (in any of MathJax's input formats) into HTML (with CSS), SVG, or MathML code.
44

55
Use
66

@@ -11,30 +11,9 @@ npm install mathjax-node
1111
to install mathjax-node and its dependencies.
1212

1313
**Note:**
14+
The current version of mathjax-node requires Node.js v6 or later, and uses jsdom version 10.
1415

15-
mathjax-node requires Node.js v4 or later.
16-
17-
**Breaking Changes in v1.0:**
18-
19-
20-
mathjax-node v1.0 makes breaking changes to the following features from the pre-releases.
21-
22-
- [CHANGED] `lib/mj-single.js` has been renamed to `lib/main.js` (and set as `main` in `package.json`, i.e., `require('mathjax-node')` will load it.
23-
- [REMOVED] `lib/mj-page.js` (API for processing HTML-fragments) and related CLI tools
24-
- [REMOVED] speech-rule-engine integration
25-
- [REMOVED] PNG generation
26-
- [REMOVED] CLI tools in `bin/`
27-
28-
These features can easily be recreated in separate modules for greater flexibility. For examples, see
29-
30-
- [mathjax-node-cli](https://github.com/mathjax/mathjax-node-cli/)
31-
- [mathjax-node-page](https://github.com/pkra/mathjax-node-page/)
32-
- [mathjax-node-sre](https://github.com/pkra/mathjax-node-sre)
33-
- [mathjax-node-svg2png](https://github.com/pkra/mathjax-node-svg2png)
34-
35-
Be sure to also check out other [projects on NPM that depend on mathjax-node](https://www.npmjs.com/browse/depended/mathjax-node).
36-
37-
# Getting started
16+
## Getting started
3817

3918
mathjax-node provides a library, `./lib/main.js`. Below is a very minimal example for using it - the tests and the examples mentioned above provide more advanced examples.
4019

@@ -52,8 +31,8 @@ var yourMath = 'E = mc^2';
5231

5332
mjAPI.typeset({
5433
math: yourMath,
55-
format: "TeX", // "inline-TeX", "MathML"
56-
mml:true, // svg:true,
34+
format: "TeX", // or "inline-TeX", "MathML"
35+
mml:true, // or svg:true, or html:true
5736
}, function (data) {
5837
if (!data.errors) {console.log(data.mml)}
5938
// will produce:
@@ -79,12 +58,12 @@ The `config` method is used to set _global_ configuration options. Its default o
7958

8059
```javascript
8160
{
82-
displayMessages: false, // determines whether Message.Set() calls are logged
83-
displayErrors: true, // determines whether error messages are shown on the console
61+
displayMessages: false, // determines whether Message.Set() calls are logged
62+
displayErrors: true, // determines whether error messages are shown on the console
8463
undefinedCharError: false, // determines whether "unknown characters" (i.e., no glyph in the configured fonts) are saved in the error array
85-
extensions: '', // a convenience option to add MathJax extensions
86-
fontURL: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/fonts/HTML-CSS', // for webfont urls in the CSS for HTML output
87-
MathJax: { } // standard MathJax configuration options, see https://docs.mathjax.org for more detail.
64+
extensions: '', // a convenience option to add MathJax extensions
65+
fontURL: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/fonts/HTML-CSS', // for webfont urls in the CSS for HTML output
66+
MathJax: { } // standard MathJax configuration options, see https://docs.mathjax.org for more detail.
8867
}
8968
```
9069

@@ -130,7 +109,7 @@ The following are the default input options.
130109

131110
speakText: true, // add textual alternative (for TeX/asciimath the input string, for MathML a dummy string)
132111

133-
state: {}, // an object to store information from multiple calls (e.g., <defs> if useGlobalCache, counter for equation numbering if equationNumbers ar )
112+
state: {}, // an object to store information from multiple calls (e.g., <defs> if useGlobalCache, counter for equation numbering if equationNumbers ar )
134113
timeout: 10 * 1000, // 10 second timeout before restarting MathJax
135114
}
136115
```
@@ -171,3 +150,35 @@ The `result` object will contain (at most) the following structure:
171150
If the `errors` array is non-empty, the Promise will reject, and be passed the `errors` array.
172151

173152
The `options` contains the configuration object passed to `typeset`; this can be useful for passing other data along or for identifying which `typeset()` call is associated with this (`callback`) call (in case you use the same `callback` function for more than one `typeset()`).
153+
154+
## Change History
155+
156+
### Breaking Changes in v2.0:
157+
158+
mathjax-node v2.0 makes breaking changes as follows:
159+
160+
- [CHANGED] mathjax-node now requires version 6 of Node.js (the minimum used to be Node.js version 4).
161+
- [CHANGED] mathjax-node now uses version 10 of jsdom. Since the jsdom API changed from 9 to 10, that means if you used jsdom in your code that calls mathjax-node, you may need to update how you call jsdom.
162+
163+
164+
### Breaking Changes in v1.0:
165+
166+
mathjax-node v1.0 makes breaking changes to the following features from the pre-releases.
167+
168+
- [CHANGED] `lib/mj-single.js` has been renamed to `lib/main.js` (and set as `main` in `package.json`, i.e., `require('mathjax-node')` will load it.
169+
- [REMOVED] `lib/mj-page.js` (API for processing HTML-fragments) and related CLI tools
170+
- [REMOVED] speech-rule-engine integration
171+
- [REMOVED] PNG generation
172+
- [REMOVED] CLI tools in `bin/`
173+
174+
These features can easily be recreated in separate modules for greater flexibility. For examples, see
175+
176+
- [mathjax-node-cli](https://github.com/mathjax/mathjax-node-cli/)
177+
- [mathjax-node-page](https://github.com/pkra/mathjax-node-page/)
178+
- [mathjax-node-sre](https://github.com/pkra/mathjax-node-sre)
179+
- [mathjax-node-svg2png](https://github.com/pkra/mathjax-node-svg2png)
180+
181+
---
182+
183+
Be sure to also check out other [projects on NPM that depend on mathjax-node](https://www.npmjs.com/browse/depended/mathjax-node).
184+

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mathjax-node",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "API's for calling MathJax from node.js",
55
"keywords": [
66
"MathJax",

0 commit comments

Comments
 (0)