Bladeren bron

Update docroc; Update documentation;

bjorn 10 jaren geleden
bovenliggende
commit
5ff922f680
3 gewijzigde bestanden met toevoegingen van 37 en 18 verwijderingen
  1. 13 13
      doc/README.md
  2. 19 0
      tools/docroc/LICENSE
  3. 5 5
      tools/docroc/init.lua

+ 13 - 13
doc/README.md

@@ -8,11 +8,11 @@ RxLua
   - [onComplete](#oncomplete)
 - [Observable](#observable)
   - [create](#createsubscribe)
+  - [subscribe](#subscribeonnext-onerror-oncomplete)
   - [fromValue](#fromvaluevalue)
   - [fromRange](#fromrangeinitial-limit-step)
   - [fromTable](#fromtabletable-iterator)
   - [fromCoroutine](#fromcoroutinecoroutine)
-  - [subscribe](#subscribeonnext-onerror-oncomplete)
   - [dump](#dumpname)
   - [changes](#changescomparator)
   - [combineLatest](#combinelatestobservables-combinator)
@@ -120,6 +120,18 @@ Returns:
 
 ---
 
+#### `:subscribe(onNext, onError, onComplete)`
+
+Shorthand for creating an Observer and passing it to this Observable's subscription function.
+
+Arguments:
+
+- `onNext` (`function`) - Called when the Observable produces a value.
+- `onError` (`function`) - Called when the Observable terminates due to an error.
+- `onComplete` (`function`) - Called when the Observable completes normally.
+
+---
+
 #### `.fromValue(value)`
 
 Creates an Observable that produces a single value.
@@ -179,18 +191,6 @@ Returns:
 
 ---
 
-#### `:subscribe(onNext, onError, onComplete)`
-
-Shorthand for creating an Observer and passing it to this Observable's subscription function.
-
-Arguments:
-
-- `onNext` (`function`) - Called when the Observable produces a value.
-- `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.

+ 19 - 0
tools/docroc/LICENSE

@@ -0,0 +1,19 @@
+Copyright (c) 2015 Bjorn Swenson
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

+ 5 - 5
tools/docroc.lua → tools/docroc/init.lua

@@ -2,9 +2,9 @@
 -- https://github.com/bjornbytes/docroc
 -- License - MIT, see LICENSE for details.
 
-local rocdoc = {}
+local docroc = {}
 
-function rocdoc.process(filename)
+function docroc.process(filename)
   local file = io.open(filename, 'r')
   local text = file:read('*a')
   file:close()
@@ -18,7 +18,7 @@ function rocdoc.process(filename)
     local tags = {}
     chunk:gsub('@(%w+)%s?([^@]*)', function(name, body)
       body = body:gsub('(%s+)$', '')
-      local processor = rocdoc.processors[name]
+      local processor = docroc.processors[name]
       local tag = processor and processor(body) or {}
       tag.tag = name
       tag.raw = body
@@ -36,7 +36,7 @@ function rocdoc.process(filename)
   return comments
 end
 
-rocdoc.processors = {
+docroc.processors = {
   description = function(body)
     return {
       text = body
@@ -84,4 +84,4 @@ rocdoc.processors = {
   end
 }
 
-return rocdoc
+return docroc