@@ -23,22 +23,41 @@ $ npm install --save-dev gulp-documentation
23
23
## Example
24
24
25
25
``` js
26
- var documentation = require (' gulp-documentation' ),
26
+ var gulpDocumentation = require (' gulp-documentation' ),
27
27
gulp = require (' gulp' );
28
28
29
+ /**
30
+ * Out of the box, you can generate JSON, HTML, and Markdown documentation
31
+ */
29
32
gulp .task (' documentation' , function () {
30
33
34
+ // Generating README documentation
31
35
gulp .src (' ./index.js' )
32
- .pipe (documentation ({ format: ' md' }))
36
+ .pipe (gulpDocumentation ({ format: ' md' }))
33
37
.pipe (gulp .dest (' md-documentation' ));
34
38
39
+ // Generating a pretty HTML documentation site
35
40
gulp .src (' ./index.js' )
36
- .pipe (documentation ({ format: ' html' }))
41
+ .pipe (gulpDocumentation ({ format: ' html' }))
37
42
.pipe (gulp .dest (' html-documentation' ));
38
43
44
+ // Generating raw JSON documentation output
39
45
gulp .src (' ./index.js' )
40
- .pipe (documentation ({ format: ' json' }))
46
+ .pipe (gulpDocumentation ({ format: ' json' }))
41
47
.pipe (gulp .dest (' json-documentation' ));
42
48
49
+ });
50
+
51
+ /**
52
+ * Generate documentation for multiple files using normal glob syntax.
53
+ * Note that this generates one documentation output, so that it can
54
+ * easily cross-reference and use types.
55
+ */
56
+ gulp .task (' documentation' , function () {
57
+
58
+ gulp .src (' ./src/*.js' )
59
+ .pipe (gulpDocumentation ({ format: ' md' }))
60
+ .pipe (gulp .dest (' md-documentation' ));
61
+
43
62
});
44
63
```
0 commit comments