From ecdb8524ce23d7dc2146dc14e2ff4243e2bc831e Mon Sep 17 00:00:00 2001 From: josdejong Date: Tue, 6 Aug 2013 02:14:10 +0200 Subject: [PATCH] Docs rewritten to modules --- src/docs/constants/Infinity.js | 2 +- src/docs/constants/LN10.js | 2 +- src/docs/constants/LN2.js | 2 +- src/docs/constants/LOG10E.js | 2 +- src/docs/constants/LOG2E.js | 2 +- src/docs/constants/NaN.js | 2 +- src/docs/constants/SQRT1_2.js | 2 +- src/docs/constants/SQRT2.js | 2 +- src/docs/constants/e.js | 2 +- src/docs/constants/false.js | 2 +- src/docs/constants/i.js | 2 +- src/docs/constants/pi.js | 2 +- src/docs/constants/tau.js | 2 +- src/docs/constants/true.js | 2 +- src/docs/function/arithmetic/abs.js | 2 +- src/docs/function/arithmetic/add.js | 2 +- src/docs/function/arithmetic/ceil.js | 2 +- src/docs/function/arithmetic/cube.js | 2 +- src/docs/function/arithmetic/divide.js | 2 +- src/docs/function/arithmetic/edivide.js | 2 +- src/docs/function/arithmetic/emultiply.js | 2 +- src/docs/function/arithmetic/epow.js | 2 +- src/docs/function/arithmetic/equal.js | 2 +- src/docs/function/arithmetic/exp.js | 2 +- src/docs/function/arithmetic/fix.js | 2 +- src/docs/function/arithmetic/floor.js | 2 +- src/docs/function/arithmetic/gcd.js | 2 +- src/docs/function/arithmetic/larger.js | 2 +- src/docs/function/arithmetic/largereq.js | 2 +- src/docs/function/arithmetic/lcm.js | 2 +- src/docs/function/arithmetic/log.js | 2 +- src/docs/function/arithmetic/log10.js | 2 +- src/docs/function/arithmetic/mod.js | 2 +- src/docs/function/arithmetic/multiply.js | 2 +- src/docs/function/arithmetic/pow.js | 2 +- src/docs/function/arithmetic/round.js | 2 +- src/docs/function/arithmetic/sign.js | 2 +- src/docs/function/arithmetic/smaller.js | 2 +- src/docs/function/arithmetic/smallereq.js | 2 +- src/docs/function/arithmetic/sqrt.js | 2 +- src/docs/function/arithmetic/square.js | 2 +- src/docs/function/arithmetic/subtract.js | 2 +- src/docs/function/arithmetic/unary.js | 2 +- src/docs/function/arithmetic/unequal.js | 2 +- src/docs/function/arithmetic/xgcd.js | 2 +- src/docs/function/complex/arg.js | 2 +- src/docs/function/complex/conj.js | 2 +- src/docs/function/complex/im.js | 2 +- src/docs/function/complex/re.js | 2 +- src/docs/function/construction/boolean.js | 2 +- src/docs/function/construction/complex.js | 2 +- src/docs/function/construction/matrix.js | 2 +- src/docs/function/construction/number.js | 2 +- src/docs/function/construction/range.js | 2 +- src/docs/function/construction/string.js | 2 +- src/docs/function/construction/unit.js | 2 +- src/docs/function/matrix/concat.js | 2 +- src/docs/function/matrix/det.js | 2 +- src/docs/function/matrix/diag.js | 2 +- src/docs/function/matrix/eye.js | 2 +- src/docs/function/matrix/inv.js | 2 +- src/docs/function/matrix/ones.js | 2 +- src/docs/function/matrix/size.js | 2 +- src/docs/function/matrix/squeeze.js | 2 +- src/docs/function/matrix/subset.js | 2 +- src/docs/function/matrix/transpose.js | 2 +- src/docs/function/matrix/zeros.js | 2 +- src/docs/function/probability/factorial.js | 2 +- src/docs/function/probability/random.js | 16 +-- src/docs/function/probability/randomInt.js | 13 +++ src/docs/function/statistics/max.js | 2 +- src/docs/function/statistics/min.js | 2 +- src/docs/function/trigonometry/acos.js | 2 +- src/docs/function/trigonometry/asin.js | 2 +- src/docs/function/trigonometry/atan.js | 2 +- src/docs/function/trigonometry/atan2.js | 2 +- src/docs/function/trigonometry/cos.js | 2 +- src/docs/function/trigonometry/cot.js | 2 +- src/docs/function/trigonometry/csc.js | 2 +- src/docs/function/trigonometry/sec.js | 2 +- src/docs/function/trigonometry/sin.js | 2 +- src/docs/function/trigonometry/tan.js | 2 +- src/docs/function/units/in.js | 2 +- src/docs/function/utils/clone.js | 2 +- src/docs/function/utils/eval.js | 2 +- src/docs/function/utils/format.js | 2 +- src/docs/function/utils/help.js | 2 +- src/docs/function/utils/import.js | 2 +- src/docs/function/utils/typeof.js | 2 +- src/docs/index.js | 110 +++++++++++++++++++++ src/index.js | 3 + 91 files changed, 214 insertions(+), 102 deletions(-) create mode 100644 src/docs/function/probability/randomInt.js create mode 100644 src/docs/index.js diff --git a/src/docs/constants/Infinity.js b/src/docs/constants/Infinity.js index 904cc3ba3..181ae1693 100644 --- a/src/docs/constants/Infinity.js +++ b/src/docs/constants/Infinity.js @@ -1,4 +1,4 @@ -math.docs['Infinity'] = { +module.exports = { 'name': 'Infinity', 'category': 'Constants', 'syntax': [ diff --git a/src/docs/constants/LN10.js b/src/docs/constants/LN10.js index 397125574..f9bad91a0 100644 --- a/src/docs/constants/LN10.js +++ b/src/docs/constants/LN10.js @@ -1,4 +1,4 @@ -math.docs.LN10 = { +module.exports = { 'name': 'LN10', 'category': 'Constants', 'syntax': [ diff --git a/src/docs/constants/LN2.js b/src/docs/constants/LN2.js index 58e0418dc..fad9b55c2 100644 --- a/src/docs/constants/LN2.js +++ b/src/docs/constants/LN2.js @@ -1,4 +1,4 @@ -math.docs.LN2 = { +module.exports = { 'name': 'LN2', 'category': 'Constants', 'syntax': [ diff --git a/src/docs/constants/LOG10E.js b/src/docs/constants/LOG10E.js index a10581c3f..2b8c7da2c 100644 --- a/src/docs/constants/LOG10E.js +++ b/src/docs/constants/LOG10E.js @@ -1,4 +1,4 @@ -math.docs.LOG10E = { +module.exports = { 'name': 'LOG10E', 'category': 'Constants', 'syntax': [ diff --git a/src/docs/constants/LOG2E.js b/src/docs/constants/LOG2E.js index 3cf300a7c..ebd1fa1b1 100644 --- a/src/docs/constants/LOG2E.js +++ b/src/docs/constants/LOG2E.js @@ -1,4 +1,4 @@ -math.docs.LOG2E = { +module.exports = { 'name': 'LOG2E', 'category': 'Constants', 'syntax': [ diff --git a/src/docs/constants/NaN.js b/src/docs/constants/NaN.js index c3da35e94..afcf76a2d 100644 --- a/src/docs/constants/NaN.js +++ b/src/docs/constants/NaN.js @@ -1,4 +1,4 @@ -math.docs['NaN'] = { +module.exports = { 'name': 'NaN', 'category': 'Constants', 'syntax': [ diff --git a/src/docs/constants/SQRT1_2.js b/src/docs/constants/SQRT1_2.js index 414ac02f6..0ed86aaef 100644 --- a/src/docs/constants/SQRT1_2.js +++ b/src/docs/constants/SQRT1_2.js @@ -1,4 +1,4 @@ -math.docs.SQRT1_2 = { +module.exports = { 'name': 'SQRT1_2', 'category': 'Constants', 'syntax': [ diff --git a/src/docs/constants/SQRT2.js b/src/docs/constants/SQRT2.js index d924a93d0..d89d4c3c4 100644 --- a/src/docs/constants/SQRT2.js +++ b/src/docs/constants/SQRT2.js @@ -1,4 +1,4 @@ -math.docs.SQRT2 = { +module.exports = { 'name': 'SQRT2', 'category': 'Constants', 'syntax': [ diff --git a/src/docs/constants/e.js b/src/docs/constants/e.js index 76f68e4f9..c12df5319 100644 --- a/src/docs/constants/e.js +++ b/src/docs/constants/e.js @@ -1,4 +1,4 @@ -math.docs.e = math.docs.E = { +module.exports = { 'name': 'e', 'category': 'Constants', 'syntax': [ diff --git a/src/docs/constants/false.js b/src/docs/constants/false.js index 851192b3c..851084e6e 100644 --- a/src/docs/constants/false.js +++ b/src/docs/constants/false.js @@ -1,4 +1,4 @@ -math.docs['false'] = { +module.exports = { 'name': 'false', 'category': 'Constants', 'syntax': [ diff --git a/src/docs/constants/i.js b/src/docs/constants/i.js index 3a2bf396e..ae340203a 100644 --- a/src/docs/constants/i.js +++ b/src/docs/constants/i.js @@ -1,4 +1,4 @@ -math.docs.i = { +module.exports = { 'name': 'i', 'category': 'Constants', 'syntax': [ diff --git a/src/docs/constants/pi.js b/src/docs/constants/pi.js index be6016c0e..ed7ea151d 100644 --- a/src/docs/constants/pi.js +++ b/src/docs/constants/pi.js @@ -1,4 +1,4 @@ -math.docs.pi = math.docs.PI = { +module.exports = { 'name': 'pi', 'category': 'Constants', 'syntax': [ diff --git a/src/docs/constants/tau.js b/src/docs/constants/tau.js index 79037ccd7..76e3f254b 100644 --- a/src/docs/constants/tau.js +++ b/src/docs/constants/tau.js @@ -1,4 +1,4 @@ -math.docs.tau = { +module.exports = { 'name': 'tau', 'category': 'Constants', 'syntax': [ diff --git a/src/docs/constants/true.js b/src/docs/constants/true.js index 76645e9e4..fce262c3a 100644 --- a/src/docs/constants/true.js +++ b/src/docs/constants/true.js @@ -1,4 +1,4 @@ -math.docs['true'] = { +module.exports = { 'name': 'true', 'category': 'Constants', 'syntax': [ diff --git a/src/docs/function/arithmetic/abs.js b/src/docs/function/arithmetic/abs.js index bdba0447f..4b5bf329b 100644 --- a/src/docs/function/arithmetic/abs.js +++ b/src/docs/function/arithmetic/abs.js @@ -1,4 +1,4 @@ -math.docs.abs = { +module.exports = { 'name': 'abs', 'category': 'Arithmetic', 'syntax': [ diff --git a/src/docs/function/arithmetic/add.js b/src/docs/function/arithmetic/add.js index 37c77ee38..0c4193c55 100644 --- a/src/docs/function/arithmetic/add.js +++ b/src/docs/function/arithmetic/add.js @@ -1,4 +1,4 @@ -math.docs.add = { +module.exports = { 'name': 'add', 'category': 'Operators', 'syntax': [ diff --git a/src/docs/function/arithmetic/ceil.js b/src/docs/function/arithmetic/ceil.js index bab05975f..1395437a0 100644 --- a/src/docs/function/arithmetic/ceil.js +++ b/src/docs/function/arithmetic/ceil.js @@ -1,4 +1,4 @@ -math.docs.ceil = { +module.exports = { 'name': 'ceil', 'category': 'Arithmetic', 'syntax': [ diff --git a/src/docs/function/arithmetic/cube.js b/src/docs/function/arithmetic/cube.js index 2d1b3c57b..21c586678 100644 --- a/src/docs/function/arithmetic/cube.js +++ b/src/docs/function/arithmetic/cube.js @@ -1,4 +1,4 @@ -math.docs.cube = { +module.exports = { 'name': 'cube', 'category': 'Arithmetic', 'syntax': [ diff --git a/src/docs/function/arithmetic/divide.js b/src/docs/function/arithmetic/divide.js index 60a64a601..fbc51a9f6 100644 --- a/src/docs/function/arithmetic/divide.js +++ b/src/docs/function/arithmetic/divide.js @@ -1,4 +1,4 @@ -math.docs.divide = { +module.exports = { 'name': 'divide', 'category': 'Operators', 'syntax': [ diff --git a/src/docs/function/arithmetic/edivide.js b/src/docs/function/arithmetic/edivide.js index 369137772..40c503d8d 100644 --- a/src/docs/function/arithmetic/edivide.js +++ b/src/docs/function/arithmetic/edivide.js @@ -1,4 +1,4 @@ -math.docs.edivide = { +module.exports = { 'name': 'edivide', 'category': 'Operators', 'syntax': [ diff --git a/src/docs/function/arithmetic/emultiply.js b/src/docs/function/arithmetic/emultiply.js index de895e504..909026da0 100644 --- a/src/docs/function/arithmetic/emultiply.js +++ b/src/docs/function/arithmetic/emultiply.js @@ -1,4 +1,4 @@ -math.docs.emultiply = { +module.exports = { 'name': 'emultiply', 'category': 'Operators', 'syntax': [ diff --git a/src/docs/function/arithmetic/epow.js b/src/docs/function/arithmetic/epow.js index 3563b5ec9..367c0f11d 100644 --- a/src/docs/function/arithmetic/epow.js +++ b/src/docs/function/arithmetic/epow.js @@ -1,4 +1,4 @@ -math.docs.epow = { +module.exports = { 'name': 'epow', 'category': 'Operators', 'syntax': [ diff --git a/src/docs/function/arithmetic/equal.js b/src/docs/function/arithmetic/equal.js index a12bee411..e1b1eca27 100644 --- a/src/docs/function/arithmetic/equal.js +++ b/src/docs/function/arithmetic/equal.js @@ -1,4 +1,4 @@ -math.docs.equal = { +module.exports = { 'name': 'equal', 'category': 'Operators', 'syntax': [ diff --git a/src/docs/function/arithmetic/exp.js b/src/docs/function/arithmetic/exp.js index 7b9f5d748..e3afaafb1 100644 --- a/src/docs/function/arithmetic/exp.js +++ b/src/docs/function/arithmetic/exp.js @@ -1,4 +1,4 @@ -math.docs.exp = { +module.exports = { 'name': 'exp', 'category': 'Arithmetic', 'syntax': [ diff --git a/src/docs/function/arithmetic/fix.js b/src/docs/function/arithmetic/fix.js index 51297d99d..94f6b762a 100644 --- a/src/docs/function/arithmetic/fix.js +++ b/src/docs/function/arithmetic/fix.js @@ -1,4 +1,4 @@ -math.docs.fix = { +module.exports = { 'name': 'fix', 'category': 'Arithmetic', 'syntax': [ diff --git a/src/docs/function/arithmetic/floor.js b/src/docs/function/arithmetic/floor.js index 64e80e4ea..2075fd3ee 100644 --- a/src/docs/function/arithmetic/floor.js +++ b/src/docs/function/arithmetic/floor.js @@ -1,4 +1,4 @@ -math.docs.floor = { +module.exports = { 'name': 'floor', 'category': 'Arithmetic', 'syntax': [ diff --git a/src/docs/function/arithmetic/gcd.js b/src/docs/function/arithmetic/gcd.js index 5fa776795..160ceb138 100644 --- a/src/docs/function/arithmetic/gcd.js +++ b/src/docs/function/arithmetic/gcd.js @@ -1,4 +1,4 @@ -math.docs.gcd = { +module.exports = { 'name': 'gcd', 'category': 'Arithmetic', 'syntax': [ diff --git a/src/docs/function/arithmetic/larger.js b/src/docs/function/arithmetic/larger.js index 559e60024..c7506d4f9 100644 --- a/src/docs/function/arithmetic/larger.js +++ b/src/docs/function/arithmetic/larger.js @@ -1,4 +1,4 @@ -math.docs.larger = { +module.exports = { 'name': 'larger', 'category': 'Operators', 'syntax': [ diff --git a/src/docs/function/arithmetic/largereq.js b/src/docs/function/arithmetic/largereq.js index 1e1f8221f..3f6725b16 100644 --- a/src/docs/function/arithmetic/largereq.js +++ b/src/docs/function/arithmetic/largereq.js @@ -1,4 +1,4 @@ -math.docs.largereq = { +module.exports = { 'name': 'largereq', 'category': 'Operators', 'syntax': [ diff --git a/src/docs/function/arithmetic/lcm.js b/src/docs/function/arithmetic/lcm.js index abc72e345..c06bb0da5 100644 --- a/src/docs/function/arithmetic/lcm.js +++ b/src/docs/function/arithmetic/lcm.js @@ -1,4 +1,4 @@ -math.docs.lcm = { +module.exports = { 'name': 'lcm', 'category': 'Arithmetic', 'syntax': [ diff --git a/src/docs/function/arithmetic/log.js b/src/docs/function/arithmetic/log.js index 0f455d30f..1117d63fa 100644 --- a/src/docs/function/arithmetic/log.js +++ b/src/docs/function/arithmetic/log.js @@ -1,4 +1,4 @@ -math.docs.log = { +module.exports = { 'name': 'log', 'category': 'Arithmetic', 'syntax': [ diff --git a/src/docs/function/arithmetic/log10.js b/src/docs/function/arithmetic/log10.js index 367e487d2..4c1035875 100644 --- a/src/docs/function/arithmetic/log10.js +++ b/src/docs/function/arithmetic/log10.js @@ -1,4 +1,4 @@ -math.docs.log10 = { +module.exports = { 'name': 'log10', 'category': 'Arithmetic', 'syntax': [ diff --git a/src/docs/function/arithmetic/mod.js b/src/docs/function/arithmetic/mod.js index f1625eb9e..8b96d915f 100644 --- a/src/docs/function/arithmetic/mod.js +++ b/src/docs/function/arithmetic/mod.js @@ -1,4 +1,4 @@ -math.docs.mod = { +module.exports = { 'name': 'mod', 'category': 'Operators', 'syntax': [ diff --git a/src/docs/function/arithmetic/multiply.js b/src/docs/function/arithmetic/multiply.js index b57e15984..c808d35e6 100644 --- a/src/docs/function/arithmetic/multiply.js +++ b/src/docs/function/arithmetic/multiply.js @@ -1,4 +1,4 @@ -math.docs.multiply = { +module.exports = { 'name': 'multiply', 'category': 'Operators', 'syntax': [ diff --git a/src/docs/function/arithmetic/pow.js b/src/docs/function/arithmetic/pow.js index ea72c2224..87fda66b7 100644 --- a/src/docs/function/arithmetic/pow.js +++ b/src/docs/function/arithmetic/pow.js @@ -1,4 +1,4 @@ -math.docs.pow = { +module.exports = { 'name': 'pow', 'category': 'Operators', 'syntax': [ diff --git a/src/docs/function/arithmetic/round.js b/src/docs/function/arithmetic/round.js index b20e055c6..8dd193f0b 100644 --- a/src/docs/function/arithmetic/round.js +++ b/src/docs/function/arithmetic/round.js @@ -1,4 +1,4 @@ -math.docs.round = { +module.exports = { 'name': 'round', 'category': 'Arithmetic', 'syntax': [ diff --git a/src/docs/function/arithmetic/sign.js b/src/docs/function/arithmetic/sign.js index 4d4057315..432196951 100644 --- a/src/docs/function/arithmetic/sign.js +++ b/src/docs/function/arithmetic/sign.js @@ -1,4 +1,4 @@ -math.docs.sign = { +module.exports = { 'name': 'sign', 'category': 'Arithmetic', 'syntax': [ diff --git a/src/docs/function/arithmetic/smaller.js b/src/docs/function/arithmetic/smaller.js index aa56c7550..e6f7118de 100644 --- a/src/docs/function/arithmetic/smaller.js +++ b/src/docs/function/arithmetic/smaller.js @@ -1,4 +1,4 @@ -math.docs.smaller = { +module.exports = { 'name': 'smaller', 'category': 'Operators', 'syntax': [ diff --git a/src/docs/function/arithmetic/smallereq.js b/src/docs/function/arithmetic/smallereq.js index 0e4aa27d2..f52a1f5be 100644 --- a/src/docs/function/arithmetic/smallereq.js +++ b/src/docs/function/arithmetic/smallereq.js @@ -1,4 +1,4 @@ -math.docs.smallereq = { +module.exports = { 'name': 'smallereq', 'category': 'Operators', 'syntax': [ diff --git a/src/docs/function/arithmetic/sqrt.js b/src/docs/function/arithmetic/sqrt.js index 849de7132..d2d6d1cea 100644 --- a/src/docs/function/arithmetic/sqrt.js +++ b/src/docs/function/arithmetic/sqrt.js @@ -1,4 +1,4 @@ -math.docs.sqrt = { +module.exports = { 'name': 'sqrt', 'category': 'Arithmetic', 'syntax': [ diff --git a/src/docs/function/arithmetic/square.js b/src/docs/function/arithmetic/square.js index 0bd1e62b6..99ccae2fc 100644 --- a/src/docs/function/arithmetic/square.js +++ b/src/docs/function/arithmetic/square.js @@ -1,4 +1,4 @@ -math.docs.square = { +module.exports = { 'name': 'square', 'category': 'Arithmetic', 'syntax': [ diff --git a/src/docs/function/arithmetic/subtract.js b/src/docs/function/arithmetic/subtract.js index fd7599dba..2ffefba6b 100644 --- a/src/docs/function/arithmetic/subtract.js +++ b/src/docs/function/arithmetic/subtract.js @@ -1,4 +1,4 @@ -math.docs.subtract = { +module.exports = { 'name': 'subtract', 'category': 'Operators', 'syntax': [ diff --git a/src/docs/function/arithmetic/unary.js b/src/docs/function/arithmetic/unary.js index f998f7f81..964b3acb6 100644 --- a/src/docs/function/arithmetic/unary.js +++ b/src/docs/function/arithmetic/unary.js @@ -1,4 +1,4 @@ -math.docs.unary = { +module.exports = { 'name': 'unary', 'category': 'Operators', 'syntax': [ diff --git a/src/docs/function/arithmetic/unequal.js b/src/docs/function/arithmetic/unequal.js index 9aab11266..2311c5aa6 100644 --- a/src/docs/function/arithmetic/unequal.js +++ b/src/docs/function/arithmetic/unequal.js @@ -1,4 +1,4 @@ -math.docs.unequal = { +module.exports = { 'name': 'unequal', 'category': 'Operators', 'syntax': [ diff --git a/src/docs/function/arithmetic/xgcd.js b/src/docs/function/arithmetic/xgcd.js index 3f11cedc1..c7232ac22 100644 --- a/src/docs/function/arithmetic/xgcd.js +++ b/src/docs/function/arithmetic/xgcd.js @@ -1,4 +1,4 @@ -math.docs.xgcd = { +module.exports = { 'name': 'xgcd', 'category': 'Arithmetic', 'syntax': [ diff --git a/src/docs/function/complex/arg.js b/src/docs/function/complex/arg.js index 2daee96a5..6f14b1fb8 100644 --- a/src/docs/function/complex/arg.js +++ b/src/docs/function/complex/arg.js @@ -1,4 +1,4 @@ -math.docs.arg = { +module.exports = { 'name': 'arg', 'category': 'Complex', 'syntax': [ diff --git a/src/docs/function/complex/conj.js b/src/docs/function/complex/conj.js index d8240d364..b57b9813d 100644 --- a/src/docs/function/complex/conj.js +++ b/src/docs/function/complex/conj.js @@ -1,4 +1,4 @@ -math.docs.conj = { +module.exports = { 'name': 'conj', 'category': 'Complex', 'syntax': [ diff --git a/src/docs/function/complex/im.js b/src/docs/function/complex/im.js index 7316b987c..7608d6575 100644 --- a/src/docs/function/complex/im.js +++ b/src/docs/function/complex/im.js @@ -1,4 +1,4 @@ -math.docs.im = { +module.exports = { 'name': 'im', 'category': 'Complex', 'syntax': [ diff --git a/src/docs/function/complex/re.js b/src/docs/function/complex/re.js index b14defbbf..6fa53efeb 100644 --- a/src/docs/function/complex/re.js +++ b/src/docs/function/complex/re.js @@ -1,4 +1,4 @@ -math.docs.re = { +module.exports = { 'name': 're', 'category': 'Complex', 'syntax': [ diff --git a/src/docs/function/construction/boolean.js b/src/docs/function/construction/boolean.js index 1e3dcf569..5d830a2b0 100644 --- a/src/docs/function/construction/boolean.js +++ b/src/docs/function/construction/boolean.js @@ -1,4 +1,4 @@ -math.docs['boolean'] = { +module.exports = { 'name': 'boolean', 'category': 'Type', 'syntax': [ diff --git a/src/docs/function/construction/complex.js b/src/docs/function/construction/complex.js index ba93be9f8..76882d6f9 100644 --- a/src/docs/function/construction/complex.js +++ b/src/docs/function/construction/complex.js @@ -1,4 +1,4 @@ -math.docs.complex = { +module.exports = { 'name': 'complex', 'category': 'Type', 'syntax': [ diff --git a/src/docs/function/construction/matrix.js b/src/docs/function/construction/matrix.js index f17b66e6f..513b11e9e 100644 --- a/src/docs/function/construction/matrix.js +++ b/src/docs/function/construction/matrix.js @@ -1,4 +1,4 @@ -math.docs.matrix = { +module.exports = { 'name': 'matrix', 'category': 'Type', 'syntax': [ diff --git a/src/docs/function/construction/number.js b/src/docs/function/construction/number.js index 18543fb40..72cf9a97a 100644 --- a/src/docs/function/construction/number.js +++ b/src/docs/function/construction/number.js @@ -1,4 +1,4 @@ -math.docs.number = { +module.exports = { 'name': 'number', 'category': 'Type', 'syntax': [ diff --git a/src/docs/function/construction/range.js b/src/docs/function/construction/range.js index 4f6449be7..55dfa5591 100644 --- a/src/docs/function/construction/range.js +++ b/src/docs/function/construction/range.js @@ -1,4 +1,4 @@ -math.docs.range = { +module.exports = { 'name': 'range', 'category': 'Type', 'syntax': [ diff --git a/src/docs/function/construction/string.js b/src/docs/function/construction/string.js index c0f202bb3..ceb6b42dd 100644 --- a/src/docs/function/construction/string.js +++ b/src/docs/function/construction/string.js @@ -1,4 +1,4 @@ -math.docs.string = { +module.exports = { 'name': 'string', 'category': 'Type', 'syntax': [ diff --git a/src/docs/function/construction/unit.js b/src/docs/function/construction/unit.js index 4531b9504..5917182c9 100644 --- a/src/docs/function/construction/unit.js +++ b/src/docs/function/construction/unit.js @@ -1,4 +1,4 @@ -math.docs.unit = { +module.exports = { 'name': 'unit', 'category': 'Type', 'syntax': [ diff --git a/src/docs/function/matrix/concat.js b/src/docs/function/matrix/concat.js index 4e5834575..270fadf91 100644 --- a/src/docs/function/matrix/concat.js +++ b/src/docs/function/matrix/concat.js @@ -1,4 +1,4 @@ -math.docs.concat = { +module.exports = { 'name': 'concat', 'category': 'Matrix', 'syntax': [ diff --git a/src/docs/function/matrix/det.js b/src/docs/function/matrix/det.js index 3455ec0d9..aafb283e2 100644 --- a/src/docs/function/matrix/det.js +++ b/src/docs/function/matrix/det.js @@ -1,4 +1,4 @@ -math.docs.det = { +module.exports = { 'name': 'det', 'category': 'Matrix', 'syntax': [ diff --git a/src/docs/function/matrix/diag.js b/src/docs/function/matrix/diag.js index 0a62f16cf..473d87530 100644 --- a/src/docs/function/matrix/diag.js +++ b/src/docs/function/matrix/diag.js @@ -1,4 +1,4 @@ -math.docs.diag = { +module.exports = { 'name': 'diag', 'category': 'Matrix', 'syntax': [ diff --git a/src/docs/function/matrix/eye.js b/src/docs/function/matrix/eye.js index d5a23cb22..5163b840d 100644 --- a/src/docs/function/matrix/eye.js +++ b/src/docs/function/matrix/eye.js @@ -1,4 +1,4 @@ -math.docs.eye = { +module.exports = { 'name': 'eye', 'category': 'Matrix', 'syntax': [ diff --git a/src/docs/function/matrix/inv.js b/src/docs/function/matrix/inv.js index 8debbaefa..2afe90f5f 100644 --- a/src/docs/function/matrix/inv.js +++ b/src/docs/function/matrix/inv.js @@ -1,4 +1,4 @@ -math.docs.inv = { +module.exports = { 'name': 'inv', 'category': 'Matrix', 'syntax': [ diff --git a/src/docs/function/matrix/ones.js b/src/docs/function/matrix/ones.js index 5f0127369..c2d7f31b1 100644 --- a/src/docs/function/matrix/ones.js +++ b/src/docs/function/matrix/ones.js @@ -1,4 +1,4 @@ -math.docs.ones = { +module.exports = { 'name': 'ones', 'category': 'Matrix', 'syntax': [ diff --git a/src/docs/function/matrix/size.js b/src/docs/function/matrix/size.js index 8c96a085a..b41856a74 100644 --- a/src/docs/function/matrix/size.js +++ b/src/docs/function/matrix/size.js @@ -1,4 +1,4 @@ -math.docs.size = { +module.exports = { 'name': 'size', 'category': 'Matrix', 'syntax': [ diff --git a/src/docs/function/matrix/squeeze.js b/src/docs/function/matrix/squeeze.js index 3a5167222..adfdd48f6 100644 --- a/src/docs/function/matrix/squeeze.js +++ b/src/docs/function/matrix/squeeze.js @@ -1,4 +1,4 @@ -math.docs.squeeze = { +module.exports = { 'name': 'squeeze', 'category': 'Matrix', 'syntax': [ diff --git a/src/docs/function/matrix/subset.js b/src/docs/function/matrix/subset.js index 186d929f5..a99f11e69 100644 --- a/src/docs/function/matrix/subset.js +++ b/src/docs/function/matrix/subset.js @@ -1,4 +1,4 @@ -math.docs.subset = { +module.exports = { 'name': 'subset', 'category': 'Matrix', 'syntax': [ diff --git a/src/docs/function/matrix/transpose.js b/src/docs/function/matrix/transpose.js index e80ae1ad3..f0fbca22e 100644 --- a/src/docs/function/matrix/transpose.js +++ b/src/docs/function/matrix/transpose.js @@ -1,4 +1,4 @@ -math.docs.transpose = { +module.exports = { 'name': 'transpose', 'category': 'Matrix', 'syntax': [ diff --git a/src/docs/function/matrix/zeros.js b/src/docs/function/matrix/zeros.js index b94fecc1d..4a4506bbc 100644 --- a/src/docs/function/matrix/zeros.js +++ b/src/docs/function/matrix/zeros.js @@ -1,4 +1,4 @@ -math.docs.zeros = { +module.exports = { 'name': 'zeros', 'category': 'Matrix', 'syntax': [ diff --git a/src/docs/function/probability/factorial.js b/src/docs/function/probability/factorial.js index 674c1de40..dc146cda0 100644 --- a/src/docs/function/probability/factorial.js +++ b/src/docs/function/probability/factorial.js @@ -1,4 +1,4 @@ -math.docs.factorial = { +module.exports = { 'name': 'factorial', 'category': 'Probability', 'syntax': [ diff --git a/src/docs/function/probability/random.js b/src/docs/function/probability/random.js index e931b4ffe..9a04f643c 100644 --- a/src/docs/function/probability/random.js +++ b/src/docs/function/probability/random.js @@ -1,4 +1,4 @@ -math.docs.random = { +module.exports = { 'name': 'random', 'category': 'Probability', 'syntax': [ @@ -11,17 +11,3 @@ math.docs.random = { ], 'seealso': [] }; - -math.docs.randInt = { - 'name': 'randInt', - 'category': 'Probability', - 'syntax': [ - 'randInt()' - ], - 'description': - 'Return a random number between 0 and 1.', - 'examples': [ - 'randInt()' - ], - 'seealso': [] -}; \ No newline at end of file diff --git a/src/docs/function/probability/randomInt.js b/src/docs/function/probability/randomInt.js new file mode 100644 index 000000000..f0da378e8 --- /dev/null +++ b/src/docs/function/probability/randomInt.js @@ -0,0 +1,13 @@ +module.exports = { + 'name': 'randInt', + 'category': 'Probability', + 'syntax': [ + 'randInt()' + ], + 'description': + 'Return a random number between 0 and 1.', + 'examples': [ + 'randInt()' + ], + 'seealso': [] +}; \ No newline at end of file diff --git a/src/docs/function/statistics/max.js b/src/docs/function/statistics/max.js index d4fd6a933..5941a0e72 100644 --- a/src/docs/function/statistics/max.js +++ b/src/docs/function/statistics/max.js @@ -1,4 +1,4 @@ -math.docs.max = { +module.exports = { 'name': 'max', 'category': 'Statistics', 'syntax': [ diff --git a/src/docs/function/statistics/min.js b/src/docs/function/statistics/min.js index f30c17b72..adfb7f487 100644 --- a/src/docs/function/statistics/min.js +++ b/src/docs/function/statistics/min.js @@ -1,4 +1,4 @@ -math.docs.min = { +module.exports = { 'name': 'min', 'category': 'Statistics', 'syntax': [ diff --git a/src/docs/function/trigonometry/acos.js b/src/docs/function/trigonometry/acos.js index 042d5cd17..78ffe9da6 100644 --- a/src/docs/function/trigonometry/acos.js +++ b/src/docs/function/trigonometry/acos.js @@ -1,4 +1,4 @@ -math.docs.acos = { +module.exports = { 'name': 'acos', 'category': 'Trigonometry', 'syntax': [ diff --git a/src/docs/function/trigonometry/asin.js b/src/docs/function/trigonometry/asin.js index 78a2f9bae..6e53189e0 100644 --- a/src/docs/function/trigonometry/asin.js +++ b/src/docs/function/trigonometry/asin.js @@ -1,4 +1,4 @@ -math.docs.asin = { +module.exports = { 'name': 'asin', 'category': 'Trigonometry', 'syntax': [ diff --git a/src/docs/function/trigonometry/atan.js b/src/docs/function/trigonometry/atan.js index c41c1c22a..4780256da 100644 --- a/src/docs/function/trigonometry/atan.js +++ b/src/docs/function/trigonometry/atan.js @@ -1,4 +1,4 @@ -math.docs.atan = { +module.exports = { 'name': 'atan', 'category': 'Trigonometry', 'syntax': [ diff --git a/src/docs/function/trigonometry/atan2.js b/src/docs/function/trigonometry/atan2.js index 9356b8aad..da6dc5a29 100644 --- a/src/docs/function/trigonometry/atan2.js +++ b/src/docs/function/trigonometry/atan2.js @@ -1,4 +1,4 @@ -math.docs.atan2 = { +module.exports = { 'name': 'atan2', 'category': 'Trigonometry', 'syntax': [ diff --git a/src/docs/function/trigonometry/cos.js b/src/docs/function/trigonometry/cos.js index 8d57f5a8f..412df2baf 100644 --- a/src/docs/function/trigonometry/cos.js +++ b/src/docs/function/trigonometry/cos.js @@ -1,4 +1,4 @@ -math.docs.cos = { +module.exports = { 'name': 'cos', 'category': 'Trigonometry', 'syntax': [ diff --git a/src/docs/function/trigonometry/cot.js b/src/docs/function/trigonometry/cot.js index c461fad5c..1d7fa12b8 100644 --- a/src/docs/function/trigonometry/cot.js +++ b/src/docs/function/trigonometry/cot.js @@ -1,4 +1,4 @@ -math.docs.cot = { +module.exports = { 'name': 'cot', 'category': 'Trigonometry', 'syntax': [ diff --git a/src/docs/function/trigonometry/csc.js b/src/docs/function/trigonometry/csc.js index cbb4bd3f4..bfe7d6fde 100644 --- a/src/docs/function/trigonometry/csc.js +++ b/src/docs/function/trigonometry/csc.js @@ -1,4 +1,4 @@ -math.docs.csc = { +module.exports = { 'name': 'csc', 'category': 'Trigonometry', 'syntax': [ diff --git a/src/docs/function/trigonometry/sec.js b/src/docs/function/trigonometry/sec.js index 7e756d14c..9b931aa6a 100644 --- a/src/docs/function/trigonometry/sec.js +++ b/src/docs/function/trigonometry/sec.js @@ -1,4 +1,4 @@ -math.docs.sec = { +module.exports = { 'name': 'sec', 'category': 'Trigonometry', 'syntax': [ diff --git a/src/docs/function/trigonometry/sin.js b/src/docs/function/trigonometry/sin.js index 40156a41f..6d6f7f7a8 100644 --- a/src/docs/function/trigonometry/sin.js +++ b/src/docs/function/trigonometry/sin.js @@ -1,4 +1,4 @@ -math.docs.sin = { +module.exports = { 'name': 'sin', 'category': 'Trigonometry', 'syntax': [ diff --git a/src/docs/function/trigonometry/tan.js b/src/docs/function/trigonometry/tan.js index 065767439..14c281982 100644 --- a/src/docs/function/trigonometry/tan.js +++ b/src/docs/function/trigonometry/tan.js @@ -1,4 +1,4 @@ -math.docs.tan = { +module.exports = { 'name': 'tan', 'category': 'Trigonometry', 'syntax': [ diff --git a/src/docs/function/units/in.js b/src/docs/function/units/in.js index 3098825bf..572c7f350 100644 --- a/src/docs/function/units/in.js +++ b/src/docs/function/units/in.js @@ -1,4 +1,4 @@ -math.docs['in'] = { +module.exports = { 'name': 'in', 'category': 'Units', 'syntax': [ diff --git a/src/docs/function/utils/clone.js b/src/docs/function/utils/clone.js index 32c177fbd..18ca109c3 100644 --- a/src/docs/function/utils/clone.js +++ b/src/docs/function/utils/clone.js @@ -1,4 +1,4 @@ -math.docs.clone = { +module.exports = { 'name': 'clone', 'category': 'Utils', 'syntax': [ diff --git a/src/docs/function/utils/eval.js b/src/docs/function/utils/eval.js index aba89b703..0eba6892e 100644 --- a/src/docs/function/utils/eval.js +++ b/src/docs/function/utils/eval.js @@ -1,4 +1,4 @@ -math.docs['eval'] = { +module.exports = { 'name': 'eval', 'category': 'Utils', 'syntax': [ diff --git a/src/docs/function/utils/format.js b/src/docs/function/utils/format.js index 983302150..98ad21f5f 100644 --- a/src/docs/function/utils/format.js +++ b/src/docs/function/utils/format.js @@ -1,4 +1,4 @@ -math.docs.format = { +module.exports = { 'name': 'format', 'category': 'Utils', 'syntax': [ diff --git a/src/docs/function/utils/help.js b/src/docs/function/utils/help.js index 128247be2..20a011a0b 100644 --- a/src/docs/function/utils/help.js +++ b/src/docs/function/utils/help.js @@ -1,4 +1,4 @@ -math.docs.help = { +module.exports = { 'name': 'help', 'category': 'Utils', 'syntax': [ diff --git a/src/docs/function/utils/import.js b/src/docs/function/utils/import.js index a161ba038..b9efc92cf 100644 --- a/src/docs/function/utils/import.js +++ b/src/docs/function/utils/import.js @@ -1,4 +1,4 @@ -math.docs['import'] = { +module.exports = { 'name': 'import', 'category': 'Utils', 'syntax': [ diff --git a/src/docs/function/utils/typeof.js b/src/docs/function/utils/typeof.js index 657a5cf87..71e329bc9 100644 --- a/src/docs/function/utils/typeof.js +++ b/src/docs/function/utils/typeof.js @@ -1,4 +1,4 @@ -math.docs['typeof'] = { +module.exports = { 'name': 'typeof', 'category': 'Utils', 'syntax': [ diff --git a/src/docs/index.js b/src/docs/index.js new file mode 100644 index 000000000..21b82313b --- /dev/null +++ b/src/docs/index.js @@ -0,0 +1,110 @@ +// constants +exports.e = require('./constants/e.js'); +exports.E = require('./constants/e.js'); +exports['false'] = require('./constants/false.js'); +exports.i = require('./constants/i.js'); +exports['Infinity'] = require('./constants/Infinity.js'); +exports.LN2 = require('./constants/LN2.js'); +exports.LN10 = require('./constants/LN10.js'); +exports.LOG2E = require('./constants/LOG2E.js'); +exports.LOG10E = require('./constants/LOG10E.js'); +exports.NaN = require('./constants/NaN.js'); +exports.pi = require('./constants/pi.js'); +exports.PI = require('./constants/pi.js'); +exports.SQRT1_2 = require('./constants/SQRT1_2.js'); +exports.SQRT2 = require('./constants/SQRT2.js'); +exports.tau = require('./constants/tau.js'); +exports['true'] = require('./constants/true.js'); + +// functions - arithmetic +exports.abs = require('./function/arithmetic/abs.js'); +exports.add = require('./function/arithmetic/add.js'); +exports.ceil = require('./function/arithmetic/ceil.js'); +exports.cube = require('./function/arithmetic/cube.js'); +exports.divide = require('./function/arithmetic/divide.js'); +exports.edivide = require('./function/arithmetic/edivide.js'); +exports.emultiply = require('./function/arithmetic/emultiply.js'); +exports.epow = require('./function/arithmetic/epow.js'); +exports.equal = require('./function/arithmetic/equal.js'); +exports.exp = require('./function/arithmetic/exp.js'); +exports.fix = require('./function/arithmetic/fix.js'); +exports.floor = require('./function/arithmetic/floor.js'); +exports.gcd = require('./function/arithmetic/gcd.js'); +exports.larger = require('./function/arithmetic/larger.js'); +exports.largereq = require('./function/arithmetic/largereq.js'); +exports.lcm = require('./function/arithmetic/lcm.js'); +exports.log = require('./function/arithmetic/log.js'); +exports.log10 = require('./function/arithmetic/log10.js'); +exports.mod = require('./function/arithmetic/mod.js'); +exports.multiply = require('./function/arithmetic/multiply.js'); +exports.pow = require('./function/arithmetic/pow.js'); +exports.round = require('./function/arithmetic/round.js'); +exports.sign = require('./function/arithmetic/sign.js'); +exports.smaller = require('./function/arithmetic/smaller.js'); +exports.smallereq = require('./function/arithmetic/smallereq.js'); +exports.sqrt = require('./function/arithmetic/sqrt.js'); +exports.square = require('./function/arithmetic/square.js'); +exports.subtract = require('./function/arithmetic/subtract.js'); +exports.unary = require('./function/arithmetic/unary.js'); +exports.unequal = require('./function/arithmetic/unequal.js'); +exports.xgcd = require('./function/arithmetic/xgcd.js'); + +// functions - complex +exports.arg = require('./function/complex/arg.js'); +exports.conj = require('./function/complex/conj.js'); +exports.re = require('./function/complex/re.js'); +exports.im = require('./function/complex/im.js'); + +// functions - construction +exports.boolean = require('./function/construction/boolean.js'); +exports.complex = require('./function/construction/complex.js'); +exports.matrix = require('./function/construction/matrix.js'); +exports.number = require('./function/construction/number.js'); +exports.range = require('./function/construction/range.js'); +exports.string = require('./function/construction/string.js'); +exports.unit = require('./function/construction/unit.js'); + +// functions - matrix +exports.concat = require('./function/matrix/concat.js'); +exports.det = require('./function/matrix/det.js'); +exports.diag = require('./function/matrix/diag.js'); +exports.eye = require('./function/matrix/eye.js'); +exports.inv = require('./function/matrix/inv.js'); +exports.ones = require('./function/matrix/ones.js'); +exports.size = require('./function/matrix/size.js'); +exports.squeeze = require('./function/matrix/squeeze.js'); +exports.subset = require('./function/matrix/subset.js'); +exports.transpose = require('./function/matrix/transpose.js'); +exports.zeros = require('./function/matrix/zeros.js'); + +// functions - probability +exports.factorial = require('./function/probability/factorial.js'); +exports.random = require('./function/probability/random.js'); +exports.randomInt = require('./function/probability/randomInt.js'); + +// functions - statistics +exports.min = require('./function/statistics/min.js'); +exports.max = require('./function/statistics/max.js'); + +// functions - trigonometry +exports.acos = require('./function/trigonometry/acos.js'); +exports.asin = require('./function/trigonometry/asin.js'); +exports.atan = require('./function/trigonometry/atan.js'); +exports.atan2 = require('./function/trigonometry/atan2.js'); +exports.cos = require('./function/trigonometry/cos.js'); +exports.cot = require('./function/trigonometry/cot.js'); +exports.csc = require('./function/trigonometry/csc.js'); +exports.sec = require('./function/trigonometry/sec.js'); +exports.sin = require('./function/trigonometry/sin.js'); +exports.tan = require('./function/trigonometry/tan.js'); + +// functions - units +exports['in'] = require('./function/units/in.js'); + +// functions - utils +exports.clone = require('./function/utils/clone.js'); +exports['eval'] = require('./function/utils/eval.js'); +exports.format = require('./function/utils/format.js'); +exports.help = require('./function/utils/help.js'); +exports['import'] = require('./function/utils/import.js'); +exports['typeof'] = require('./function/utils/typeof.js'); diff --git a/src/index.js b/src/index.js index bafd01574..8ed0c5f29 100644 --- a/src/index.js +++ b/src/index.js @@ -108,3 +108,6 @@ exports['typeof'] = require('./function/utils/typeof.js'); var object = require('./util/object.js'); var constants = require('./constants.js'); object.extend(exports, constants); + +// docs +exports.docs = require('./docs/index.js');