in documentation use foo, not <code>foo</code>
This commit is contained in:
parent
bd5a4b6318
commit
73fa856900
16 changed files with 89 additions and 105 deletions
|
|
@ -76,8 +76,8 @@ Some conventions:
|
|||
|
||||
(function(global) {
|
||||
/*@
|
||||
Ox <f> The <code>Ox</code> object
|
||||
See <code>Ox.wrap</code> for details.
|
||||
Ox <f> The `Ox` object
|
||||
See `Ox.wrap` for details.
|
||||
(value) -> <o> wrapped value
|
||||
value <*> Any value
|
||||
@*/
|
||||
|
|
@ -87,7 +87,7 @@ Some conventions:
|
|||
})(this);
|
||||
|
||||
/*@
|
||||
Ox.Break <f> Breaks from <code>Ox.forEach</code> and <code>Ox.loop</code>
|
||||
Ox.Break <f> Breaks from `Ox.forEach` and `Ox.loop`
|
||||
@*/
|
||||
Ox.Break = function() {
|
||||
throw Ox.BreakError;
|
||||
|
|
@ -97,12 +97,11 @@ Ox.BreakError = new SyntaxError('Illegal Ox.Break() statement');
|
|||
|
||||
/*@
|
||||
Ox.load <f> Loads a module
|
||||
A module named "Foo" provides <code>Ox.Foo/Ox.Foo.js</code>, in which it
|
||||
defines one method, <code>Ox.load.Foo</code>, that takes two arguments,
|
||||
<code>options</code> and <code>callback</code>, and calls
|
||||
<code>callback</code> with one argument, <code>true</code> for success or
|
||||
<code>false</code> if an error occurred. Generally, the module should
|
||||
define <code>Ox.Foo</code> and attach its own methods there.
|
||||
A module named "Foo" provides `Ox.Foo/Ox.Foo.js`, in which it defines one
|
||||
method, `Ox.load.Foo`, that takes two arguments, `options` and `callback`,
|
||||
and calls `callback` with one argument, `true` for success or `false` if an
|
||||
error occurred. Generally, the module should define `Ox.Foo` and attach its
|
||||
own methods there.
|
||||
(module, callback) -> <u> undefined
|
||||
(module, options, callback) -> <u> undefined
|
||||
(modules, callback) -> <u> undefined
|
||||
|
|
@ -240,20 +239,19 @@ Ox.Log = (function() {
|
|||
|
||||
/*@
|
||||
Ox.loop <f> For-loop, functional-style
|
||||
Returning <code>false</code> from the iterator function acts like a
|
||||
<code>break</code> statement. Unlike a <code>for</code> loop,
|
||||
<code>Ox.loop</code> doesn't leak its counter variable to the outer scope,
|
||||
but returns it.
|
||||
Returning `false` from the iterator function acts like a `break` statement.
|
||||
Unlike a `for` loop, `Ox.loop` doesn't leak its counter variable to the
|
||||
outer scope, but returns it.
|
||||
(stop, fn) -> <n> Next value
|
||||
equivalent to <code>for (var i = 0; i < stop; i++) { fn(i); }</code>
|
||||
equivalent to `for (var i = 0; i < stop; i++) { fn(i); }`
|
||||
(start, stop, fn) -> <n> Next value
|
||||
equivalent to <code>for (var i = start; i < stop; i++) { fn(i); }</code>
|
||||
or, if <code>start</code> is larger than <code>stop</code>,
|
||||
<code>for (var i = start; i > stop; i--) { fn(i); }</code>
|
||||
equivalent to `for (var i = start; i < stop; i++) { fn(i); }` or, if
|
||||
`start` is larger than `stop`, `for (var i = start; i > stop; i--) {
|
||||
fn(i); }`
|
||||
(start, stop, step, fn) -> <n> Next value
|
||||
equivalent to <code>for (var i = start; i < stop; i += step) { fn(i);
|
||||
}</code> or, if <code>step</code> is negative, <code>for (var i = start;
|
||||
i > stop; i += step) { fn(i); }</code>
|
||||
equivalent to `for (var i = start; i < stop; i += step) { fn(i); }` or,
|
||||
if `step` is negative, `for (var i = start; i > stop; i += step) {
|
||||
fn(i); }`
|
||||
start <n> Start value
|
||||
stop <n> Stop value (exclusive)
|
||||
step <n> Step value
|
||||
|
|
@ -321,10 +319,10 @@ Ox.uid = (function() {
|
|||
|
||||
/*@
|
||||
Ox.wrap <f> Wraps a value so that one can directly call any Ox function on it
|
||||
<code>Ox(value)</code> is a shorthand for <code>Ox.wrap(value)</code>.
|
||||
`Ox(value)` is a shorthand for `Ox.wrap(value)`.
|
||||
(value) -> <o> wrapped value
|
||||
chain <f> Wrap return values to allow chaining
|
||||
value <f> Unwrap the value wrapped by <code>chain()</chain>
|
||||
value <f> Unwrap the value wrapped by `chain()`
|
||||
value <*> Any value
|
||||
> Ox("foobar").repeat(2)
|
||||
"foobarfoobar"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue