Skip to content

Commit 047102e

Browse files
committed
docs: WIP better order in docs/README.md
1 parent a661708 commit 047102e

File tree

1 file changed

+28
-24
lines changed

1 file changed

+28
-24
lines changed

docs/README.md

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,11 @@ When you require the module
8484
var Gulp = require('gulp-runtime');
8585
```
8686

87-
you get a constructor with 2 static methods
87+
you get a constructor
8888

89-
### Gulp.create
89+
### Static methods
90+
91+
#### Gulp.create
9092

9193
```js
9294
function create(Object options)
@@ -98,7 +100,7 @@ function create(Object options)
98100
- `options.repl = false` no REPL by default
99101
- `options.wait = false` tasks run in __parallel__ by default. Pass `wait: true` to run tasks in __series__
100102

101-
### Gulp.createClass
103+
#### Gulp.createClass
102104

103105
```js
104106
function createClass(Object mixin)
@@ -119,7 +121,9 @@ var Gulp = require('gulp-runtime').createClass({
119121
})
120122
```
121123

122-
### gulp.task
124+
### Instance methods
125+
126+
#### gulp.task
123127

124128
`gulp.src`, `gulp.dest`, `gulp.watch` and `gulp.task` behave the same as described in the [`gulp` API documentation][gulp-api].
125129

@@ -148,7 +152,7 @@ gulp.task('build:mode(-dev|-prod)', function (done){
148152

149153
The parameters are defined using [parth][parth]. There you will find more information about what qualifies as parameter and what not.
150154

151-
### gulp.start
155+
#### gulp.start
152156

153157
`gulp.start` can be used in two ways
154158

@@ -208,25 +212,6 @@ gulp.task('default', function (done) {
208212
});
209213
```
210214

211-
## REPL
212-
213-
```js
214-
var gulp = require('gulp-runtime').create({repl: true});
215-
```
216-
217-
When an instance passes `repl: true` the process running will not stop but wait and have a REPL listening on `stdin`. This way you can run tasks in the same way you run commands on the terminal.
218-
219-
```js
220-
node gulpfile.js
221-
# some task logging here...
222-
# when done press enter
223-
> build less compress png
224-
```
225-
226-
- If those tasks are defined they will run in __parallel__
227-
- If there is more than one instance with `repl: true` the REPL will go through them and run the first task that matched one of those tasks
228-
- If one or more of those tasks is not defined there will be a warning and none of the tasks will run for that instance of any of the other ones
229-
230215
## async composers
231216

232217
`gulp.start` is not enough when you need to compose tasks since it runs them. If you want to compose tasks, you need another function that will run a set of tasks.
@@ -270,6 +255,25 @@ function stack(tasks...[, Object options])
270255
- `options.onHandleError` if given, will run when a task errors
271256
- `options.onStackEnd` if given, will run when all of the stacked functions have ended (including error)
272257

258+
## REPL
259+
260+
```js
261+
var gulp = require('gulp-runtime').create({repl: true});
262+
```
263+
264+
When an instance passes `repl: true` the process running will not stop but wait and have a REPL listening on `stdin`. This way you can run tasks in the same way you run commands on the terminal.
265+
266+
```js
267+
node gulpfile.js
268+
# some task logging here...
269+
# when done press enter
270+
> build less compress png
271+
```
272+
273+
- If those tasks are defined they will run in __parallel__
274+
- If there is more than one instance with `repl: true` the REPL will go through them and run the first task that matched one of those tasks
275+
- If one or more of those tasks is not defined there will be a warning and none of the tasks will run for that instance of any of the other ones
276+
273277
## instances
274278

275279
Exactly, instances. That means that you can split builds into instances within the same process and run them separately. Which is a bit better than taking care of naming or spin another process to run them separated. This is also better for performance since all of the modules that may be used by other build can be reused.

0 commit comments

Comments
 (0)