use markdown

This commit is contained in:
rolux 2012-05-30 13:34:57 +02:00
commit 9269b96469
4 changed files with 44 additions and 47 deletions

View file

@ -2,15 +2,15 @@
/*@
Ox.api <f> Turns an array into a list API
<code>Ox.api</code> takes an array and returns a function that allows you to
run complex queries against it. See the examples below for details.
`Ox.api` takes an array and returns a function that allows you to run
complex queries against it. See the examples below for details.
(items, options) -> <f> List API
items <[o]> An array of objects (key/value stores)
options <o> Options object
cache <b|false> If true, cache results
enums <o> Enumerables, for example <code>{size: ['S', 'M', 'L']}</code>
enums <o> Enumerables, for example `{size: ['S', 'M', 'L']}`
geo <b|false> If true, return combined area with totals
sort <[o]|[s]> Default sort, for example <code> ['+name', '-age']
sort <[o]|[s]> Default sort, for example `['+name', '-age']`
sums <[s]> List of keys to be included in totals
unique <s|'id'> The name of the unique key
<script>
@ -328,7 +328,7 @@ Ox.api = function(items, options) {
};
/*@
Ox.compact <f> Removes <code>null</code> or <code>undefined</code> values
Ox.compact <f> Removes `null` or `undefined` values
(array) -> <a> Array
> Ox.compact([null,,1,,2,,3])
[1, 2, 3]
@ -434,14 +434,13 @@ Ox.makeArray = function(value) {
/*@
Ox.range <f> Python-style range
(stop) -> <[n]> range
Returns an array of integers from <code>0</code> (inclusive) to
<code>stop</code> (exclusive).
Returns an array of integers from `0` (inclusive) to `stop` (exclusive).
(start, stop) -> <[n]> range
Returns an array of integers from <code>start</code> (inclusive) to
<code>stop</code> (exclusive).
Returns an array of integers from `start` (inclusive) to `stop`
(exclusive).
(start, stop, step) -> <[n]> range
Returns an array of numbers from <code>start</code> (inclusive) to
<code>stop</code> (exclusive), incrementing by <code>step</code>.
Returns an array of numbers from `start` (inclusive) to `stop`
(exclusive), incrementing by `step`.
start <n> Start value
stop <n> Stop value
step <n> Step value