diff --git a/browser/xparsejax.js b/browser/xparsejax.js index b6caf04..d206a6f 100644 --- a/browser/xparsejax.js +++ b/browser/xparsejax.js @@ -1 +1 @@ -(()=>{"use strict";const e=MathJax._.input.tex.Configuration,t=e.Configuration,a=(e.ConfigurationHandler,e.ParserConfiguration,MathJax._.input.tex.TokenMap),n=(a.parseResult,a.AbstractTokenMap,a.RegExpMap,a.AbstractParseMap,a.CharacterMap,a.DelimiterMap,a.MacroMap,a.CommandMap),r=(a.EnvironmentMap,MathJax._.input.tex.Token),o=(r.Token,r.Macro),s=MathJax._.input.tex.TexError.default,c=MathJax._.input.tex.ParseUtil.default,i="xparseCmdMap";let u={};u.documentCmd=function(e,t){const a=function(e,t){let a=c.trimSpaces(e.GetArgument(t));if("\\"===a.charAt(0)&&(a=a.substring(1)),!a.match(/^(.|[a-z]+)$/i))throw new s("IllegalControlSequenceName","First argument of '%1' must be a command.",e.currentCS);return a}(e,t),n=function(e){const t=[];switch(e.GetNext()){case"}":throw new s("ExtraCloseMissingOpen","Extra close brace or missing open brace");case"{":for(e.i++;e.i(a,n)=>{const r=[];if(t.length){for(const e of t)switch(e.type){case"m":r.push(a.GetArgument(n));break;case"o":r.push(a.GetBrackets(n)||"-NoValue-");break;case"O":r.push(a.GetBrackets(n)||e.default);break;case"s":r.push(a.GetStar()?"\\BooleanTrue":"\\BooleanFalse");break;case"t":{const t=a.GetNext()===e.token;t&&a.i++,r.push(t?"\\BooleanTrue":"\\BooleanFalse");break}}e=c.substituteArgs(a,r,e)}a.string=c.addArgs(a,e,a.string.slice(a.i)),a.i=0,c.checkMaxMacros(a)})(r,n)))},u.ifBoolean=function(e,t,a){const n=c.trimSpaces(e.GetArgument(t)),r=e.GetArgument(t),o="tf"===a?e.GetArgument(t):"",i=(()=>{switch(n){case"\\BooleanTrue":return!("f"===a);case"\\BooleanFalse":return"f"===a;default:throw new s("InvalidArgument","Invalid argument "+n+" to "+e.currentCS)}})();e.string=c.addArgs(e,i?r:o,e.string.slice(e.i)),e.i=0,c.checkMaxMacros(e)},u.ifNoValue=function(e,t,a){const n=c.trimSpaces(e.GetArgument(t)),r=e.GetArgument(t),o="tf"===a?e.GetArgument(t):"",s="-NoValue-"===n?!("f"===a):"f"===a;e.string=c.addArgs(e,s?r:o,e.string.slice(e.i)),e.i=0,c.checkMaxMacros(e)},new n(i,{NewDocumentCommand:["documentCmd","new"],RenewDocumentCommand:["documentCmd","renew"],ProvideDocumentCommand:["documentCmd","provide"],DeclareDocumentCommand:["documentCmd","declare"],IfBooleanTF:["ifBoolean","tf"],IfBooleanT:["ifBoolean","t"],IfBooleanF:["ifBoolean","f"],IfNoValueTF:["ifNoValue","tf"],IfNoValueT:["ifNoValue","t"],IfNoValueF:["ifNoValue","f"]},u),t.create("xparse",{handler:{macro:[i]}})})(); \ No newline at end of file +(()=>{"use strict";const e=MathJax._.input.tex.Configuration,t=e.Configuration,a=(e.ConfigurationHandler,e.ParserConfiguration,MathJax._.input.tex.TokenMap),n=(a.parseResult,a.AbstractTokenMap,a.RegExpMap,a.AbstractParseMap,a.CharacterMap,a.DelimiterMap,a.MacroMap,a.CommandMap),r=(a.EnvironmentMap,MathJax._.input.tex.Token),o=(r.Token,r.Macro),s=MathJax._.input.tex.TexError.default,c=MathJax._.input.tex.ParseUtil.default,i="xparseCmdMap";let u={};u.documentCmd=function(e,t){const a=function(e,t){let a=c.trimSpaces(e.GetArgument(t));if("\\"===a.charAt(0)&&(a=a.substring(1)),!a.match(/^(.|[a-z]+)$/i))throw new s("IllegalControlSequenceName","First argument of '%1' must be a command.",e.currentCS);return a}(e,t),n=function(e){const t=[];switch(e.GetNext()){case"}":throw new s("ExtraCloseMissingOpen","Extra close brace or missing open brace");case"{":for(e.i++;e.i(a,n)=>{const r=[];if(t.length){for(const e of t)switch(e.type){case"m":r.push(a.GetArgument(n));break;case"o":r.push(a.GetBrackets(n)||"-NoValue-");break;case"O":r.push(a.GetBrackets(n)||e.default);break;case"s":r.push(a.GetStar()?"\\BooleanTrue":"\\BooleanFalse");break;case"t":{const t=a.GetNext()===e.token;t&&a.i++,r.push(t?"\\BooleanTrue":"\\BooleanFalse");break}}e=c.substituteArgs(a,r,e)}a.string=c.addArgs(a,e,a.string.slice(a.i)),a.i=0,c.checkMaxMacros(a)})(r,n)))},u.ifBoolean=function(e,t,a){const n=c.trimSpaces(e.GetArgument(t)),r=e.GetArgument(t),o="tf"===a?e.GetArgument(t):"",i=(()=>{switch(n){case"\\BooleanTrue":return!("f"===a);case"\\BooleanFalse":return"f"===a;default:throw new s("InvalidArgument","Invalid argument "+n+" to "+e.currentCS)}})();e.string=c.addArgs(e,i?r:o,e.string.slice(e.i)),e.i=0,c.checkMaxMacros(e)},u.ifNoValue=function(e,t,a){const n=c.trimSpaces(e.GetArgument(t)),r=e.GetArgument(t),o="tf"===a?e.GetArgument(t):"",s="-NoValue-"===n?!("f"===a):"f"===a;e.string=c.addArgs(e,s?r:o,e.string.slice(e.i)),e.i=0,c.checkMaxMacros(e)},new n(i,{NewDocumentCommand:["documentCmd","new"],RenewDocumentCommand:["documentCmd","renew"],ProvideDocumentCommand:["documentCmd","provide"],DeclareDocumentCommand:["documentCmd","declare"],IfBooleanTF:["ifBoolean","tf"],IfBooleanT:["ifBoolean","t"],IfBooleanF:["ifBoolean","f"],IfNoValueTF:["ifNoValue","tf"],IfNoValueT:["ifNoValue","t"],IfNoValueF:["ifNoValue","f"]},u);t.create("xparse",{handler:{macro:[i]}})})(); \ No newline at end of file diff --git a/js/xparsejax.d.ts b/js/xparsejax.d.ts index cb0ff5c..01b7596 100644 --- a/js/xparsejax.d.ts +++ b/js/xparsejax.d.ts @@ -1 +1,2 @@ -export {}; +import { Configuration } from 'mathjax-full/mjs/input/tex/Configuration.js'; +export declare const configuration: Configuration; diff --git a/js/xparsejax.js b/js/xparsejax.js index bdc1bd4..d558047 100644 --- a/js/xparsejax.js +++ b/js/xparsejax.js @@ -149,5 +149,5 @@ new CommandMap(XPARSEMAP, { IfNoValueT: ['ifNoValue', 't'], IfNoValueF: ['ifNoValue', 'f'], }, xparseMethods); -Configuration.create('xparse', { handler: { macro: [XPARSEMAP] } }); +export const configuration = Configuration.create('xparse', { handler: { macro: [XPARSEMAP] } }); //# sourceMappingURL=xparsejax.js.map \ No newline at end of file diff --git a/js/xparsejax.js.map b/js/xparsejax.js.map index c09a52d..046f3de 100644 --- a/js/xparsejax.js.map +++ b/js/xparsejax.js.map @@ -1 +1 @@ -{"version":3,"file":"xparsejax.js","sourceRoot":"","sources":["../ts/xparsejax.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAE5D,OAAO,QAAQ,MAAM,wCAAwC,CAAC;AAE9D,OAAO,SAAS,MAAM,yCAAyC,CAAC;AAEhE,MAAM,SAAS,GAAG,cAAc,CAAC;AAEjC,IAAI,aAAa,GAAgC,EAAE,CAAC;AAoBpD,MAAM,eAAe,GAAG,CAAC,KAAa,EAAE,OAAgB,EAAE,EAAE,CAAC,CAAC,MAAiB,EAAE,IAAY,EAAE,EAAE;IAC/F,MAAM,IAAI,GAAG,EAAE,CAAC;IAEhB,IAAI,OAAO,CAAC,MAAM,EAAE;QAClB,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE;YACzB,QAAQ,GAAG,CAAC,IAAI,EAAE;gBAChB,KAAK,GAAG;oBACN,IAAI,CAAC,IAAI,CACP,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CACzB,CAAC;oBACF,MAAM;gBACR,KAAK,GAAG;oBACN,IAAI,CAAC,IAAI,CACP,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,WAAW,CACxC,CAAC;oBACF,MAAM;gBACR,KAAK,GAAG;oBACN,IAAI,CAAC,IAAI,CACP,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,O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AM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5F,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;IACb,SAAS,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC,CAAA;AAED,IAAI,UAAU,CAAC,SAAS,EAAE;IACxB,kBAAkB,EAAE,CAAC,aAAa,EAAE,KAAK,CAAC;IAC1C,oBAAoB,EAAE,CAAC,aAAa,EAAE,OAAO,CAAC;IAC9C,sBAAsB,EAAE,CAAC,aAAa,EAAE,SAAS,CAAC;IAClD,sBAAsB,EAAE,CAAC,aAAa,EAAE,SAAS,CAAC;IAClD,WAAW,EAAE,CAAC,WAAW,EAAE,IAAI,CAAC;IAChC,UAAU,EAAE,CAAC,WAAW,EAAE,GAAG,CAAC;IAC9B,UAAU,EAAE,CAAC,WAAW,EAAE,GAAG,CAAC;IAC9B,WAAW,EAAE,CAAC,WAAW,EAAE,IAAI,CAAC;IAChC,UAAU,EAAE,CAAC,WAAW,EAAE,GAAG,CAAC;IAC9B,UAAU,EAAE,CAAC,WAAW,EAAE,GAAG,CAAC;CAC/B,EAAE,aAAa,CAAC,CAAC;AAElB,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAC,MAAM,CAC/C,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,CAC9C,CAAC"} \ No newline at end of file diff --git a/package.json b/package.json index 3c87424..51e1378 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "version": "1.0.0", "description": "", "scripts": { - "build": "cd xparsejax && node ../node_modules/mathjax-full/components/bin/pack" + "build": "npx tsc; ./node_modules/mathjax-full/components/bin/makeAll components" }, "author": "Lucas V. Reis", "license": "AGPL", diff --git a/readme.md b/readme.md index df31fe9..c082e7c 100644 --- a/readme.md +++ b/readme.md @@ -19,16 +19,16 @@ Note that `NewDocumentEnviroment` is not implemented but should not be hard to d ## Usage -There is a packed minified version under [`build`](build). You can serve it under your website (say, at `/path/to/xparsejax.js`) and load it in your MathJax configuration like so: +There is a packed minified version under [`browser`](browser). You can serve it under your website (say, at `/path/to/xparsejax.js`) and load it in your MathJax configuration like so: ```js MathJax = { loader: { - load: ['[custom]/xparsejax.js'], - paths: {custom: '/path/to'} // specify your path here + load: ['[xparsejax]/xparsejax.js'], + paths: {xparsejax: '/path/to'} // specify your path here }, tex: { - packages: {'[+]': ['xparse']}, + packages: {'[+]': ['xparsejax']}, }, [... other stuff ...] }