Skip to content

Commit 077899a

Browse files
committed
Merge pull request mathjax#160 from mathjax/issue159
Update package.json to MathJax from npm
2 parents bc924cb + 9515a16 commit 077899a

File tree

3 files changed

+40
-40
lines changed

3 files changed

+40
-40
lines changed

lib/mj-page.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ var STATE = {
8181

8282
//
8383
// The MathJaxPath is normaized against file:/// so that Windows paths are correct
84-
//
85-
var MathJaxPath = url.resolve("file:///","file:"+require.resolve('MathJax/unpacked/MathJax'));
84+
//
85+
var MathJaxPath = url.resolve("file:///","file:"+require.resolve('mathjax/unpacked/MathJax'));
8686
var BatikRasterizerPath = path.resolve(__dirname,'..','batik/batik-rasterizer.jar');
8787
var MathJaxConfig; // configuration for when starting MathJax
8888
var MathJax; // filled in once MathJax is loaded
@@ -131,13 +131,13 @@ function GetWindow() {
131131
// Node's url.resolve() has a problem with resolving a file:// URL when
132132
// the base URL is "about:blank", so force it to be something else (HACK)
133133
// since jsdom 3.x sets the base to "about:blank".
134-
//
134+
//
135135
if (document._URL === "about:blank") document._URL = "file:///blank.html";
136136
}
137137

138138
//
139139
// Set up a Mathjax configuration within the window
140-
//
140+
//
141141
function ConfigureMathJax() {
142142
window.MathJax = {
143143
//
@@ -225,7 +225,7 @@ function ConfigureMathJax() {
225225
MathJax.Hub.processSectionDelay = 0;
226226
MathJax.Hub.processUpdateTime = 10000000; // don't interrupt processing of output
227227
MathJax.Hub.processUpdateDelay = 0;
228-
228+
229229
//
230230
// Adjust the SVG output jax
231231
//
@@ -348,7 +348,7 @@ function ConfigureMathJax() {
348348
delete STYLES[".mjx-chartest .mjx-box"];
349349
delete STYLES[".mjx-test"];
350350
delete STYLES[".mjx-ex-boxtest"];
351-
351+
352352
CHTML.Augment({
353353
//
354354
// Set up the default ex-size and width
@@ -426,7 +426,7 @@ function ConfigureMathJax() {
426426
getHDW: function (c,name,styles) {
427427
return {h:.8, d:.2, w:c.length*.5};
428428
}
429-
429+
430430
});
431431

432432
});
@@ -554,7 +554,7 @@ function AddError(prefix,message,nopush) {
554554

555555
//
556556
// Start typesetting the queued expressions
557-
//
557+
//
558558
function StartQueue() {
559559
data = callback = null; // clear existing equation, if any
560560
errors = []; // clear any errors
@@ -641,7 +641,7 @@ function ConfigureTypeset() {
641641
SVG.resetGlyphs(true);
642642
if (TEX.resetEquationNUmbers) TEX.resetEquationNumbers();
643643
MML.SUPER.ID = 0;
644-
644+
645645
//
646646
// Register the preprocessors and get the jax selector
647647
//
@@ -677,7 +677,7 @@ function TypesetDone() {
677677

678678
//
679679
// Clean up the SVG for use in a page without MathJax.
680-
//
680+
//
681681
function AdjustSVG() {
682682
var nodes, i, callback;
683683
if (data.renderer === "SVG" || data.renderer === "IMG" || data.renderer === "PNG") {
@@ -716,7 +716,7 @@ function AdjustSVG() {
716716

717717
//
718718
// Clean up the HTML for use in a page without MathJax.
719-
//
719+
//
720720
function AdjustHTML() {
721721
var nodes, i, callback;
722722
if (data.renderer === "CommonHTML") {
@@ -759,7 +759,7 @@ function GetSpeech() {
759759

760760
//
761761
// Clean up the MathML for use in a page without MathJax.
762-
//
762+
//
763763
function AdjustMML() {
764764
if (data.renderer === "NativeMML") {
765765
var nodes = document.getElementsByClassName("MathJax_MathML");
@@ -897,7 +897,7 @@ function ReturnResults(result) {
897897
//
898898
// If MathJax times out, discard the DOM
899899
// and load a new one (get a fresh MathJax)
900-
//
900+
//
901901
function RestartMathJax() {
902902
if (timer) {
903903
MathJax.Hub.queue.queue = []; // clear MathJax queue, so pending operations won't fire
@@ -914,7 +914,7 @@ function RestartMathJax() {
914914

915915
//
916916
// The API call to typeset a page
917-
//
917+
//
918918
// %%% check data for correctness
919919
//
920920
exports.typeset = function (data,callback) {

lib/mj-single.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*********************************************************************
22
*
33
* mj-single-svg.js
4-
*
4+
*
55
* Implements an API to MathJax in node.js so that MathJax can be
66
* used server-side to generate SVG, MathML, or images (the latter
77
* requires an external library, batik, to do the svg to png
@@ -82,8 +82,8 @@ var STATE = {
8282

8383
//
8484
// The MathJaxPath is normaized against file:/// so that Windows paths are correct
85-
//
86-
var MathJaxPath = url.resolve("file:///","file:"+require.resolve('MathJax/unpacked/MathJax'));
85+
//
86+
var MathJaxPath = url.resolve("file:///","file:"+require.resolve('mathjax/unpacked/MathJax'));
8787
var BatikRasterizerPath = path.resolve(__dirname,'..','batik/batik-rasterizer.jar');
8888
var MathJaxConfig; // configuration for when starting MathJax
8989
var MathJax; // filled in once MathJax is loaded
@@ -133,13 +133,13 @@ function GetWindow() {
133133
// Node's url.resolve() has a problem with resolving a file:// URL when
134134
// the base URL is "about:blank", so force it to be something else (HACK)
135135
// since jsdom 3.x sets the base to "about:blank".
136-
//
136+
//
137137
if (document._URL === "about:blank") document._URL = "file:///blank.html";
138138
}
139139

140140
//
141141
// Set up a Mathjax configuration within the window
142-
//
142+
//
143143
function ConfigureMathJax() {
144144
window.MathJax = {
145145
//
@@ -170,11 +170,11 @@ function ConfigureMathJax() {
170170
Event:{}, Touch:{}, Hover:{} // fake structure to avid errors
171171
};
172172
MathJax.Ajax.loaded[MathJax.Ajax.fileURL("[MathJax]/extensions/MathEvents.js")] = true;
173-
173+
174174
//
175175
// When creating stylesheets, no need to wait for them
176176
// to become active, so just do the callback
177-
//
177+
//
178178
MathJax.Ajax.timer.create = function (callback,node) {
179179
callback = MathJax.Callback(callback);
180180
callback(this.STATUS.OK);
@@ -194,7 +194,7 @@ function ConfigureMathJax() {
194194
MathJax.Message.Clear = function () {};
195195
MathJax.Message.Remove = function () {};
196196
MathJax.Message.Init = function () {};
197-
197+
198198
//
199199
// Trap Math Processing Errors
200200
//
@@ -220,14 +220,14 @@ function ConfigureMathJax() {
220220
MathJax.Hub.Register.MessageHook("file load error",function (message) {
221221
AddError("File load error: "+message[1]);
222222
});
223-
223+
224224
//
225225
// Set the delays to 0 (we don't need to update the screen)
226226
//
227227
MathJax.Hub.processSectionDelay = 0;
228228
MathJax.Hub.processUpdateTime = 10000000; // don't interrupt processing of output
229229
MathJax.Hub.processUpdateDelay = 0;
230-
230+
231231
//
232232
// Adjust the SVG output jax
233233
//
@@ -300,7 +300,7 @@ function ConfigureMathJax() {
300300
state.SVGdelay = false;
301301
}
302302
});
303-
303+
304304
//
305305
// TEXT boxes use getBBox, which isn't implemented, so
306306
// use a monspace font and fake the size. Since these
@@ -344,7 +344,7 @@ function ConfigureMathJax() {
344344
delete STYLES[".mjx-chartest .mjx-box"];
345345
delete STYLES[".mjx-test"];
346346
delete STYLES[".mjx-ex-boxtest"];
347-
347+
348348
CHTML.Augment({
349349
//
350350
// Set up the default ex-size and width
@@ -422,7 +422,7 @@ function ConfigureMathJax() {
422422
getHDW: function (c,name,styles) {
423423
return {h:.8, d:.2, w:c.length*.5};
424424
}
425-
425+
426426
});
427427

428428
});
@@ -581,7 +581,7 @@ function GetSVG(result) {
581581
node = MathJax.HTML.Element("title",{id:id+"-Title"},["Equation"]);
582582
svg.insertBefore(node,svg.firstChild);
583583
}
584-
584+
585585
//
586586
// SVG data is modified to add linebreaks for readability,
587587
// and to put back the xlink namespace that is removed in HTML5
@@ -645,7 +645,7 @@ function GetPNG(result) {
645645

646646
//
647647
// Start typesetting the queued expressions
648-
//
648+
//
649649
function StartQueue() {
650650
data = callback = null; // clear existing equation, if any
651651
errors = []; // clear any errors
@@ -686,9 +686,9 @@ function StartQueue() {
686686

687687
//
688688
// Set the state from data.state or clear it
689-
//
689+
//
690690
GetState(data.state);
691-
691+
692692
var renderer = (data.html ? "CommonHTML" : "SVG");
693693

694694
//
@@ -714,7 +714,7 @@ function StartQueue() {
714714
//
715715
// Update the MathJax values from the state,
716716
// or clear them if there is no state.
717-
//
717+
//
718718
function GetState(state) {
719719
var SVG = MathJax.OutputJax.SVG,
720720
TEX = MathJax.InputJax.TeX,
@@ -749,7 +749,7 @@ function GetState(state) {
749749
// When the expression is typeset,
750750
// clear the timeout timer, if any,
751751
// and update the MathJax state,
752-
//
752+
//
753753
function TypesetDone(result) {
754754
if (timer) {clearTimeout(timer); timer = null}
755755
html.removeAttribute("xmlns:"+data.xmlns);
@@ -797,14 +797,14 @@ function RerenderSVG(result) {
797797
);
798798
}
799799
}
800-
800+
801801

802802
/********************************************************************/
803803

804804
//
805805
// If MathJax times out, discard the DOM
806806
// and load a new one (get a fresh MathJax)
807-
//
807+
//
808808
function RestartMathJax() {
809809
if (timer) {
810810
MathJax.Hub.queue.queue = []; // clear MathJax queue, so pending operations won't fire
@@ -821,7 +821,7 @@ function RestartMathJax() {
821821

822822
//
823823
// The API call to typeset an equation
824-
//
824+
//
825825
// %%% cache results?
826826
// %%% check types and values of parameters
827827
//

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mathjax-node",
3-
"version": "0.4.0",
3+
"version": "0.5.0",
44
"description": "API's for calling MathJax from node.js",
55
"keywords": [
66
"MathJax",
@@ -23,10 +23,10 @@
2323
"url": "git://github.com/mathjax/MathJax-node.git"
2424
},
2525
"dependencies": {
26-
"jsdom": "^7.1.0",
26+
"jsdom": "7.*",
27+
"mathjax": "*",
2728
"speech-rule-engine": "*",
28-
"yargs": "^3.0.0",
29-
"MathJax": "https://github.com/mathjax/MathJax/tarball/mathjax-node-2.5.1"
29+
"yargs": "3.*"
3030
},
3131
"scripts": {
3232
"test": "tape test/*.js"

0 commit comments

Comments
 (0)