Browse Source

Update documentation;

bjorn 10 years ago
parent
commit
bc5ab99d3c
3 changed files with 40 additions and 2 deletions
  1. 1 1
      README.md
  2. 38 0
      doc/README.md
  3. 1 1
      tools/documentation.lua

+ 1 - 1
README.md

@@ -33,7 +33,7 @@ See [examples](examples) for more.
 Documentation
 Documentation
 ---
 ---
 
 
-See [here](doc/README.md).
+See [here](doc).
 
 
 License
 License
 ---
 ---

+ 38 - 0
doc/README.md

@@ -2,6 +2,8 @@
 
 
 Observers are simple objects that receive values from Observables.
 Observers are simple objects that receive values from Observables.
 
 
+---
+
 #### `.create(onNext, onError, onComplete)`
 #### `.create(onNext, onError, onComplete)`
 
 
 Creates a new Observer.
 Creates a new Observer.
@@ -16,6 +18,8 @@ Returns:
 
 
 - `Observer`
 - `Observer`
 
 
+---
+
 #### `:onNext(value)`
 #### `:onNext(value)`
 
 
 Pushes a new value to the Observer.
 Pushes a new value to the Observer.
@@ -24,6 +28,8 @@ Arguments:
 
 
 - `value` (`*`)
 - `value` (`*`)
 
 
+---
+
 #### `:onError(message)`
 #### `:onError(message)`
 
 
 Notify the Observer that an error has occurred.
 Notify the Observer that an error has occurred.
@@ -32,6 +38,8 @@ Arguments:
 
 
 - `[message]` (`string`) - A string describing what went wrong.
 - `[message]` (`string`) - A string describing what went wrong.
 
 
+---
+
 #### `:onComplete()`
 #### `:onComplete()`
 
 
 Notify the Observer that the sequence has completed and will produce no more values.
 Notify the Observer that the sequence has completed and will produce no more values.
@@ -40,6 +48,8 @@ Notify the Observer that the sequence has completed and will produce no more val
 
 
 Observables push values to Observers.
 Observables push values to Observers.
 
 
+---
+
 #### `.create(subscribe)`
 #### `.create(subscribe)`
 
 
 Creates a new Observable.
 Creates a new Observable.
@@ -52,6 +62,8 @@ Returns:
 
 
 - `Observable`
 - `Observable`
 
 
+---
+
 #### `.fromValue(value)`
 #### `.fromValue(value)`
 
 
 Creates an Observable that produces a single value.
 Creates an Observable that produces a single value.
@@ -64,6 +76,8 @@ Returns:
 
 
 - `Observable`
 - `Observable`
 
 
+---
+
 #### `.fromCoroutine(coroutine)`
 #### `.fromCoroutine(coroutine)`
 
 
 Creates an Observable that produces values when the specified coroutine yields.
 Creates an Observable that produces values when the specified coroutine yields.
@@ -76,6 +90,8 @@ Returns:
 
 
 - `Observable`
 - `Observable`
 
 
+---
+
 #### `:subscribe(onNext, onError, onComplete)`
 #### `:subscribe(onNext, onError, onComplete)`
 
 
 Shorthand for creating an Observer and passing it to this Observable's subscription function.
 Shorthand for creating an Observer and passing it to this Observable's subscription function.
@@ -86,6 +102,8 @@ Arguments:
 - `onError` (`function`) - Called when the Observable terminates due to an error.
 - `onError` (`function`) - Called when the Observable terminates due to an error.
 - `onComplete` (`function`) - Called when the Observable completes normally.
 - `onComplete` (`function`) - Called when the Observable completes normally.
 
 
+---
+
 #### `:dump(name)`
 #### `:dump(name)`
 
 
 Subscribes to this Observable and prints values it produces.
 Subscribes to this Observable and prints values it produces.
@@ -94,6 +112,8 @@ Arguments:
 
 
 - `[name]` (`string`) - Prefixes the printed messages with a name.
 - `[name]` (`string`) - Prefixes the printed messages with a name.
 
 
+---
+
 #### `:first()`
 #### `:first()`
 
 
 Returns a new Observable that only produces the first result of the original.
 Returns a new Observable that only produces the first result of the original.
@@ -102,6 +122,8 @@ Returns:
 
 
 - `Observable`
 - `Observable`
 
 
+---
+
 #### `:last()`
 #### `:last()`
 
 
 Returns a new Observable that only produces the last result of the original.
 Returns a new Observable that only produces the last result of the original.
@@ -110,6 +132,8 @@ Returns:
 
 
 - `Observable`
 - `Observable`
 
 
+---
+
 #### `:map(callback)`
 #### `:map(callback)`
 
 
 Returns a new Observable that produces the values of the original transformed by a function.
 Returns a new Observable that produces the values of the original transformed by a function.
@@ -122,6 +146,8 @@ Returns:
 
 
 - `Observable`
 - `Observable`
 
 
+---
+
 #### `:reduce(accumulator, seed)`
 #### `:reduce(accumulator, seed)`
 
 
 Returns a new Observable that produces a single value computed by accumulating the results of running a function on each value produced by the original Observable.
 Returns a new Observable that produces a single value computed by accumulating the results of running a function on each value produced by the original Observable.
@@ -135,6 +161,8 @@ Returns:
 
 
 - `Observable`
 - `Observable`
 
 
+---
+
 #### `:sum()`
 #### `:sum()`
 
 
 Returns a new Observable that produces the sum of the values of the original Observable as a single result.
 Returns a new Observable that produces the sum of the values of the original Observable as a single result.
@@ -143,6 +171,8 @@ Returns:
 
 
 - `Observable`
 - `Observable`
 
 
+---
+
 #### `:combineLatest(observables, combinator)`
 #### `:combineLatest(observables, combinator)`
 
 
 Returns a new Observable that runs a combinator function on the most recent values from a set of Observables whenever any of them produce a new value. The results of the combinator function are produced by the new Observable.
 Returns a new Observable that runs a combinator function on the most recent values from a set of Observables whenever any of them produce a new value. The results of the combinator function are produced by the new Observable.
@@ -164,6 +194,8 @@ Schedulers manage groups of Observables.
 
 
 Manages Observables using coroutines and a virtual clock that must be updated manually.
 Manages Observables using coroutines and a virtual clock that must be updated manually.
 
 
+---
+
 #### `.create(currentTime)`
 #### `.create(currentTime)`
 
 
 Creates a new Cooperative Scheduler.
 Creates a new Cooperative Scheduler.
@@ -176,6 +208,8 @@ Returns:
 
 
 - `Scheduler.Cooperative`
 - `Scheduler.Cooperative`
 
 
+---
+
 #### `:schedule(action, delay)`
 #### `:schedule(action, delay)`
 
 
 Schedules a function to be run after an optional delay.
 Schedules a function to be run after an optional delay.
@@ -185,6 +219,8 @@ Arguments:
 - `action` (`function`) - The function to execute. Will be converted into a coroutine. The coroutine may yield execution back to the scheduler with an optional number, which will put it to sleep for a time period.
 - `action` (`function`) - The function to execute. Will be converted into a coroutine. The coroutine may yield execution back to the scheduler with an optional number, which will put it to sleep for a time period.
 - `[delay=0]` (`number`) - Delay execution of the action by a time period.
 - `[delay=0]` (`number`) - Delay execution of the action by a time period.
 
 
+---
+
 #### `:update(delta)`
 #### `:update(delta)`
 
 
 Triggers an update of the Cooperative Scheduler. The clock will be advanced and the scheduler will run any coroutines that are due to be run.
 Triggers an update of the Cooperative Scheduler. The clock will be advanced and the scheduler will run any coroutines that are due to be run.
@@ -193,6 +229,8 @@ Arguments:
 
 
 - `[delta=0]` (`number`) - An amount of time to advance the clock by. It is common to pass in the time in seconds or milliseconds elapsed since this function was last called.
 - `[delta=0]` (`number`) - An amount of time to advance the clock by. It is common to pass in the time in seconds or milliseconds elapsed since this function was last called.
 
 
+---
+
 #### `:isEmpty()`
 #### `:isEmpty()`
 
 
 Returns whether or not the Cooperative Scheduler's queue is empty.
 Returns whether or not the Cooperative Scheduler's queue is empty.

+ 1 - 1
tools/documentation.lua

@@ -25,7 +25,7 @@ for _, comment in ipairs(docroc.process('rx.lua')) do
 
 
     end
     end
 
 
-    io.write(('#### `%s`\n\n'):format(context))
+    io.write(('---\n\n#### `%s`\n\n'):format(context))
 
 
     if tags.description then
     if tags.description then
       io.write(('%s\n\n'):format(tags.description[1].text))
       io.write(('%s\n\n'):format(tags.description[1].text))