Skip to content

Commit

Permalink
Merge pull request #22 from limefrogyank/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
limefrogyank authored Nov 17, 2024
2 parents 03a8d2b + ca5a2e6 commit 4276a07
Show file tree
Hide file tree
Showing 38 changed files with 2,048 additions and 2,196 deletions.
39 changes: 39 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module.exports = {
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"overrides": [
{
"env": {
"node": true
},
"files": [
".eslintrc.{js,cjs}"
],
"parserOptions": {
"sourceType": "script"
}
}
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
// to enforce using type for object type definitions, can be type or interface
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
// force === and !== instead of == and !=
"eqeqeq": ["error", "always"],
"prefer-const": ["error", {"destructuring" : "all"}]
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,4 @@ This line should come before you add anything else and will do the same thing as

## To Build Yourself

Clone the repo, make sure you have nodejs, then `npm run build` . This will generate the 'siunitx.js' file that's already in the root folder.
Clone the repo, make sure you have nodejs, then `npm run build` . This will generate the 'siunitx.js' file that's already in the root folder.
35 changes: 29 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
//color is required for color options
//cancel is required for cancelation of units
inlineMath: { '[+]': [['$', '$']] },
/* global options can go here, see IOptions in options.ts for properties */
/* global options for siunitx can go in the siunitx object on tex, see IOptions in options.ts for properties */
// Uncomment example below:
//perMode: 'fraction'
// siunitx: {
// perMode: 'fraction'
// }
},
options:{
enableEnrichment:true,
Expand All @@ -32,10 +34,14 @@
const mml = await MathJax.tex2mmlPromise(arr[capt], {});
var regex = /(?:data-semantic-speech=")(.*?)(?:")/g;
var matches = [...mml.matchAll(regex)];
if (matches[0] === undefined) {
break; // accessibility is not turned on yet
}
table.rows[capt + 1].cells[2].innerText = matches[0][1];

}
}

await fillTableWithSpeech('angTable', ang);
await fillTableWithSpeech('numTable', num);
await fillTableWithSpeech('complexnumTable', complexnum);
Expand Down Expand Up @@ -118,8 +124,10 @@ <h2>DeclareSIUnit</h2>
var num = [
String.raw`\num{0}`,
String.raw`\num{1234}`,
String.raw`\num{1234p}`,
String.raw`\num{12345}`,
String.raw`\num{0.123}`,
String.raw`\num{0.10000}`,
String.raw`\num{.123}`,
String.raw`\num{0,1234}`,
String.raw`\num{.12345}`,
Expand Down Expand Up @@ -286,14 +294,17 @@ <h2>DeclareSIUnit</h2>
String.raw`\num[uncertainty-mode = separate]{123.45(120)}`,
String.raw`\num[uncertainty-mode = separate]{0.035(14)}`,
String.raw`\num[uncertainty-mode=separate]{1.234 +- 0.005}`,
String.raw`\num[{uncertainty-mode=compact,output-open-uncertainty=[,output-close-uncertainty=],uncertainty-separator=\,}]{1.234(5)}`,
String.raw`\num[uncertainty-mode=compact, output-open-uncertainty=[, output-close-uncertainty=], uncertainty-separator=\,]{1.234(5)}`,


String.raw`\num{-15673}`,
String.raw`\num[bracket-negative-numbers]{-15673}`,
String.raw`\num{-15673}`,
String.raw`\num[negative-color = red]{-15673}`,
String.raw`\num[negative-color = red]{15673}`,
String.raw`\num[negative-color = red,bracket-negative-numbers]{-15673}`,
String.raw`\num[negative-color = red,bracket-negative-numbers]{15673}`,


String.raw`\num{2e3}`,
String.raw`\num[tight-spacing = true]{2e3}`, //TODO: Probably more places to add tight spacing, +- uncertainty probably
Expand All @@ -302,14 +313,25 @@ <h2>DeclareSIUnit</h2>
String.raw`\num[print-implicit-plus]{345}`,
String.raw`\num{1e4}`,
String.raw`\num[print-unity-mantissa = false]{1e4}`,
String.raw`\num[print-unity-mantissa = false]{1.1e4}`,
String.raw`\num[print-unity-mantissa = false]{2e4}`,
String.raw`\num{444e0}`,
String.raw`\num[print-zero-exponent = true]{444e0}`,
String.raw`\num[print-unity-mantissa = true, print-zero-exponent = true]{1e0}`,
String.raw`\num[print-unity-mantissa = true, print-zero-exponent = false]{1e0}`,
String.raw`\num[print-unity-mantissa = false, print-zero-exponent = true]{1e0}`,
String.raw`\num[print-unity-mantissa = false, print-zero-exponent = false]{1e0}`,
String.raw`\num{0.123}`,
String.raw`\num[print-zero-integer = false]{0.123}`,
String.raw`\num{00.123}`,
String.raw`\num[print-zero-integer = false]{00.123}`,
String.raw`\num{123.00}`,
String.raw`\num[zero-decimal-as-symbol]{123.00}`,
String.raw`\num[zero-decimal-as-symbol, zero-symbol=\text{[---]}]{123.00}`,

String.raw`\num[negative-color = red,bracket-negative-numbers,print-implicit-plus]{15673}`,
String.raw`\num[negative-color = red,bracket-negative-numbers,print-implicit-plus]{-15673}`,


];

Expand Down Expand Up @@ -364,9 +386,10 @@ <h2>DeclareSIUnit</h2>
String.raw`\ang[angle-mode = decimal]{2.67}`,
String.raw`\ang[angle-mode = decimal]{2;3;4}`,
String.raw`\ang{2.67}`,
String.raw`\ang[number-angle-product = \,]{2.67}`,
String.raw`\ang[number-angle-product = {\,}]{2.67}`,
String.raw`\ang{6;7;6.5}`,
String.raw`\ang[angle-separator = \,]{6;7;6.5}`,
String.raw`\ang[angle-separator = {\,}]{6;7;6.5}`,
String.raw`\ang[angle-separator = {\,}]{6;;}`,
String.raw`\displaylines{
\ang{-1;;} \\
\ang{;-2;} \\
Expand Down Expand Up @@ -530,7 +553,7 @@ <h2>DeclareSIUnit</h2>
String.raw`\qty[per-mode = fraction]{1,345}{\coulomb\per\mole}`,
// quantity-product test
String.raw`\qty{2.67}{\farad}`,
String.raw`\qty[quantity-product = \ ]{2.67}{\farad}`,
String.raw`\qty[quantity-product = {\ }]{2.67}{\farad}`,
String.raw`\qty[quantity-product = ]{2.67}{\farad}`,
// prefix-mode, extract-mass-in-kilograms test
String.raw`\qty{1e3}{\metre\second}`,
Expand Down
Loading

0 comments on commit 4276a07

Please sign in to comment.