-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #126 from mathjax/develop
Merge develop into master
- Loading branch information
Showing
8 changed files
with
215 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
language: node_js | ||
node_js: | ||
- 'iojs' | ||
sudo: false | ||
script: | ||
- npm install | ||
- npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,37 @@ | ||
{ | ||
"name": "MathJax-node", | ||
"version": "0.3.0", | ||
"description": "API's for calling MathJax from node.js", | ||
"keywords": ["MathJax","math","svg","MathML","TeX","AsciiMath"], | ||
"maintainers": [ | ||
"MathJax Consortium <[email protected]> (http://www.mathjax.org)" | ||
], | ||
"bugs": { | ||
"url": "http://github.com/mathjax/MathJax-node/issues" | ||
}, | ||
"license": { | ||
"type": "Apache", | ||
"url": "http://github.com/mathjax/MathJax-node/blob/master/LICENSE" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/mathjax/MathJax-node.git" | ||
}, | ||
"dependencies": { | ||
"jsdom": "3.1.1", | ||
"speech-rule-engine": "*", | ||
"yargs": "*", | ||
"MathJax": "https://github.com/mathjax/MathJax/tarball/mathjax-node-2.5.1" | ||
}, | ||
"main": "./lib/mj-page.js" | ||
"name": "mathjax-node", | ||
"version": "0.4.0", | ||
"description": "API's for calling MathJax from node.js", | ||
"keywords": [ | ||
"MathJax", | ||
"math", | ||
"svg", | ||
"MathML", | ||
"TeX", | ||
"AsciiMath" | ||
], | ||
"maintainers": [ | ||
"MathJax Consortium <[email protected]> (http://www.mathjax.org)" | ||
], | ||
"bugs": { | ||
"url": "http://github.com/mathjax/MathJax-node/issues" | ||
}, | ||
"license": "Apache-2.0", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/mathjax/MathJax-node.git" | ||
}, | ||
"dependencies": { | ||
"jsdom": "^6.0.0", | ||
"speech-rule-engine": "*", | ||
"yargs": "^3.0.0", | ||
"MathJax": "https://github.com/mathjax/MathJax/tarball/mathjax-node-2.5.1" | ||
}, | ||
"scripts": { | ||
"test": "tape test/*.js" | ||
}, | ||
"main": "./lib/mj-page.js", | ||
"devDependencies": { | ||
"tape": "^4.0.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
var tape = require('tape'); | ||
var mjAPI = require("..//lib/mj-single.js"); | ||
|
||
tape('basic test: check MathJax core', function(t) { | ||
t.plan(1); | ||
|
||
var tex = ''; | ||
mjAPI.start(); | ||
|
||
mjAPI.typeset({ | ||
math: tex, | ||
format: "TeX", | ||
mml: true | ||
}, function(data) { | ||
t.ok(data.mml, 'MathJax core seems ok'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
var tape = require('tape'); | ||
var mjAPI = require("..//lib/mj-single.js"); | ||
|
||
tape('basic test: check speechruleengine', function(t) { | ||
t.plan(1); | ||
|
||
var tex = 'MathJax'; | ||
mjAPI.start(); | ||
|
||
mjAPI.typeset({ | ||
math: tex, | ||
format: "TeX", | ||
mml: true, | ||
speakText: true | ||
}, function(data) { | ||
t.ok(data.speakText, 'speechruleengine seems ok'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
var tape = require('tape'); | ||
var mjAPI = require("..//lib/mj-single.js"); | ||
var jsdom = require('jsdom').jsdom; | ||
|
||
tape('the SVG width should match the default', function(t) { | ||
t.plan(1); | ||
|
||
mjAPI.start(); | ||
var tex = 'a \\\\ b'; | ||
var expected = '100ex'; | ||
|
||
mjAPI.typeset({ | ||
math: tex, | ||
format: "TeX", | ||
svg: true | ||
}, function(data) { | ||
var document = jsdom(data.svg); | ||
var window = document.defaultView; | ||
var element = window.document.getElementsByTagName("svg")[0]; | ||
var width = element.getAttribute('width'); | ||
t.equal(width, expected); | ||
}); | ||
}); |