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
 ---
 
-See [here](doc/README.md).
+See [here](doc).
 
 License
 ---

+ 38 - 0
doc/README.md

@@ -2,6 +2,8 @@
 
 Observers are simple objects that receive values from Observables.
 
+---
+
 #### `.create(onNext, onError, onComplete)`
 
 Creates a new Observer.
@@ -16,6 +18,8 @@ Returns:
 
 - `Observer`
 
+---
+
 #### `:onNext(value)`
 
 Pushes a new value to the Observer.
@@ -24,6 +28,8 @@ Arguments:
 
 - `value` (`*`)
 
+---
+
 #### `:onError(message)`
 
 Notify the Observer that an error has occurred.
@@ -32,6 +38,8 @@ Arguments:
 
 - `[message]` (`string`) - A string describing what went wrong.
 
+---
+
 #### `:onComplete()`
 
 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.
 
+---
+
 #### `.create(subscribe)`
 
 Creates a new Observable.
@@ -52,6 +62,8 @@ Returns:
 
 - `Observable`
 
+---
+
 #### `.fromValue(value)`
 
 Creates an Observable that produces a single value.
@@ -64,6 +76,8 @@ Returns:
 
 - `Observable`
 
+---
+
 #### `.fromCoroutine(coroutine)`
 
 Creates an Observable that produces values when the specified coroutine yields.
@@ -76,6 +90,8 @@ Returns:
 
 - `Observable`
 
+---
+
 #### `:subscribe(onNext, onError, onComplete)`
 
 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.
 - `onComplete` (`function`) - Called when the Observable completes normally.
 
+---
+
 #### `:dump(name)`
 
 Subscribes to this Observable and prints values it produces.
@@ -94,6 +112,8 @@ Arguments:
 
 - `[name]` (`string`) - Prefixes the printed messages with a name.
 
+---
+
 #### `:first()`
 
 Returns a new Observable that only produces the first result of the original.
@@ -102,6 +122,8 @@ Returns:
 
 - `Observable`
 
+---
+
 #### `:last()`
 
 Returns a new Observable that only produces the last result of the original.
@@ -110,6 +132,8 @@ Returns:
 
 - `Observable`
 
+---
+
 #### `:map(callback)`
 
 Returns a new Observable that produces the values of the original transformed by a function.
@@ -122,6 +146,8 @@ Returns:
 
 - `Observable`
 
+---
+
 #### `: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.
@@ -135,6 +161,8 @@ Returns:
 
 - `Observable`
 
+---
+
 #### `:sum()`
 
 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`
 
+---
+
 #### `: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.
@@ -164,6 +194,8 @@ Schedulers manage groups of Observables.
 
 Manages Observables using coroutines and a virtual clock that must be updated manually.
 
+---
+
 #### `.create(currentTime)`
 
 Creates a new Cooperative Scheduler.
@@ -176,6 +208,8 @@ Returns:
 
 - `Scheduler.Cooperative`
 
+---
+
 #### `:schedule(action, 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.
 - `[delay=0]` (`number`) - Delay execution of the action by a time period.
 
+---
+
 #### `: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.
@@ -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.
 
+---
+
 #### `:isEmpty()`
 
 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
 
-    io.write(('#### `%s`\n\n'):format(context))
+    io.write(('---\n\n#### `%s`\n\n'):format(context))
 
     if tags.description then
       io.write(('%s\n\n'):format(tags.description[1].text))