Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 40 additions & 34 deletions bin/am2html
Original file line number Diff line number Diff line change
Expand Up @@ -23,42 +23,48 @@
* limitations under the License.
*/

var mjAPI = require("mathjax-node-sre");
const mjAPI = require("mathjax-node-sre");
const yargs = require("yargs/yargs");
const { hideBin } = require("yargs/helpers");

var argv = require("yargs")
.demand(1).strict()
.usage("$0 [options] 'math' > file.html")
.options({
speech: {
boolean: true,
default: true,
describe: "include speech text"
},
linebreaks: {
boolean: true,
describe: "perform automatic line-breaking"
},
ex: {
default: 6,
describe: "ex-size in pixels"
},
width: {
default: 100,
describe: "width of container in ex"
},
extensions: {
default: "",
describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'"
},
css: {
boolean: true,
describe: "output the required CSS rather than the HTML itself"
},
fontURL: {
default: "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/fonts/HTML-CSS",
describe: "the URL to use for web fonts"
}
const argv = yargs(hideBin(process.argv))
.usage("$0 [options] 'math' > file.html")
.option("speech", {
type: "boolean",
default: true,
describe: "include speech text"
})
.option("linebreaks", {
type: "boolean",
describe: "perform automatic line-breaking"
})
.option("ex", {
type: "number",
default: 6,
describe: "ex-size in pixels"
})
.option("width", {
type: "number",
default: 100,
describe: "width of container in ex"
})
.option("extensions", {
type: "string",
default: "",
describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'"
})
.option("css", {
type: "boolean",
describe: "output the required CSS rather than the HTML itself"
})
.option("fontURL", {
type: "string",
default: "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/fonts/HTML-CSS",
describe: "the URL to use for web fonts"
})
.demandCommand(1, "You must provide at least one math expression")
.strict()
.help()
.argv;

mjAPI.config({extensions: argv.extensions, fontURL: argv.fontURL});
Expand Down
66 changes: 36 additions & 30 deletions bin/am2htmlcss
Original file line number Diff line number Diff line change
Expand Up @@ -23,38 +23,44 @@
* limitations under the License.
*/

var mjAPI = require("mathjax-node-sre");
const mjAPI = require("mathjax-node-sre");
const yargs = require("yargs/yargs");
const { hideBin } = require("yargs/helpers");

var argv = require("yargs")
.demand(1).strict()
.usage("$0 [options] 'math' > file.html")
.options({
speech: {
boolean: true,
default: true,
describe: "include speech text"
},
linebreaks: {
boolean: true,
describe: "perform automatic line-breaking"
},
ex: {
default: 6,
describe: "ex-size in pixels"
},
width: {
default: 100,
describe: "width of container in ex"
},
extensions: {
default: "",
describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'"
},
fontURL: {
default: "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/fonts/HTML-CSS",
describe: "the URL to use for web fonts"
}
const argv = yargs(hideBin(process.argv))
.usage("$0 [options] 'math' > file.html")
.option("speech", {
type: "boolean",
default: true,
describe: "include speech text"
})
.option("linebreaks", {
type: "boolean",
describe: "perform automatic line-breaking"
})
.option("ex", {
type: "number",
default: 6,
describe: "ex-size in pixels"
})
.option("width", {
type: "number",
default: 100,
describe: "width of container in ex"
})
.option("extensions", {
type: "string",
default: "",
describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'"
})
.option("fontURL", {
type: "string",
default: "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/fonts/HTML-CSS",
describe: "the URL to use for web fonts"
})
.demandCommand(1, "You must provide at least one math expression")
.strict()
.help()
.argv;

mjAPI.config({extensions: argv.extensions, fontURL: argv.fontURL});
Expand Down
39 changes: 21 additions & 18 deletions bin/am2mml
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,29 @@
* limitations under the License.
*/

var mjAPI = require("mathjax-node-sre");
const mjAPI = require("mathjax-node-sre");
const yargs = require("yargs/yargs");
const { hideBin } = require("yargs/helpers");

var argv = require("yargs")
.demand(1).strict()
.usage("$0 [options] 'math' > file.mml")
.options({
speech: {
boolean: true,
default: true,
describe: "include speech text"
},
semantics: {
boolean: true,
describe: "add AsciiMath code in <semantics> tag"
},
extensions: {
default: "",
describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'"
}
const argv = yargs(hideBin(process.argv))
.usage("$0 [options] 'math' > file.mml")
.option("speech", {
type: "boolean",
default: true,
describe: "include speech text"
})
.option("semantics", {
type: "boolean",
describe: "add AsciiMath code in <semantics> tag"
})
.option("extensions", {
type: "string",
default: "",
describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'"
})
.demandCommand(1, "You must provide at least one math expression")
.strict()
.help()
.argv;

mjAPI.config({
Expand Down
66 changes: 36 additions & 30 deletions bin/am2svg
Original file line number Diff line number Diff line change
Expand Up @@ -23,38 +23,44 @@
* limitations under the License.
*/

var mjAPI = require("mathjax-node-sre");
const mjAPI = require("mathjax-node-sre");
const yargs = require("yargs/yargs");
const { hideBin } = require("yargs/helpers");

var argv = require("yargs")
.demand(1).strict()
.usage("$0 [options] 'math' > file.svg")
.options({
linebreaks: {
boolean: true,
default: true,
describe: "perform automatic line-breaking"
},
speech: {
boolean: true,
describe: "include speech text"
},
font: {
default: "TeX",
describe: "web font to use"
},
ex: {
default: 6,
describe: "ex-size in pixels"
},
width: {
default: 100,
describe: "width of container in ex"
},
extensions: {
default: "",
describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'"
}
const argv = yargs(hideBin(process.argv))
.usage("$0 [options] 'math' > file.svg")
.option("linebreaks", {
type: "boolean",
default: true,
describe: "perform automatic line-breaking"
})
.option("speech", {
type: "boolean",
describe: "include speech text"
})
.option("font", {
type: "string",
default: "TeX",
describe: "web font to use"
})
.option("ex", {
type: "number",
default: 6,
describe: "ex-size in pixels"
})
.option("width", {
type: "number",
default: 100,
describe: "width of container in ex"
})
.option("extensions", {
type: "string",
default: "",
describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'"
})
.demandCommand(1, "You must provide at least one math expression")
.strict()
.help()
.argv;

if (argv.font === "STIX") argv.font = "STIX-Web";
Expand Down
74 changes: 40 additions & 34 deletions bin/mml2html
Original file line number Diff line number Diff line change
Expand Up @@ -23,42 +23,48 @@
* limitations under the License.
*/

var mjAPI = require("mathjax-node-sre");
const mjAPI = require("mathjax-node-sre");
const yargs = require("yargs/yargs");
const { hideBin } = require("yargs/helpers");

var argv = require("yargs")
.demand(1).strict()
.usage("$0 [options] 'math' > file.html")
.options({
speech: {
boolean: true,
default: true,
describe: "include speech text"
},
linebreaks: {
boolean: true,
describe: "perform automatic line-breaking"
},
ex: {
default: 6,
describe: "ex-size in pixels"
},
width: {
default: 100,
describe: "width of container in ex"
},
extensions: {
default: "",
describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'"
},
css: {
boolean: true,
describe: "output the required CSS rather than the HTML itself"
},
fontURL: {
default: "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/fonts/HTML-CSS",
describe: "the URL to use for web fonts"
}
const argv = yargs(hideBin(process.argv))
.usage("$0 [options] 'math' > file.html")
.option("speech", {
type: "boolean",
default: true,
describe: "include speech text"
})
.option("linebreaks", {
type: "boolean",
describe: "perform automatic line-breaking"
})
.option("ex", {
type: "number",
default: 6,
describe: "ex-size in pixels"
})
.option("width", {
type: "number",
default: 100,
describe: "width of container in ex"
})
.option("extensions", {
type: "string",
default: "",
describe: "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'"
})
.option("css", {
type: "boolean",
describe: "output the required CSS rather than the HTML itself"
})
.option("fontURL", {
type: "string",
default: "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/fonts/HTML-CSS",
describe: "the URL to use for web fonts"
})
.demandCommand(1, "You must provide at least one math expression")
.strict()
.help()
.argv;

mjAPI.config({extensions: argv.extensions});
Expand Down
Loading