Skip to content

Commit

Permalink
added documentation on explicit files feature
Browse files Browse the repository at this point in the history
  • Loading branch information
zeachco committed Dec 16, 2016
1 parent c958a97 commit ffb02d9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@

gulp-task-list is a [gulp](http://gulpjs.com) task that lists all tasks in gulpfile.js along with their comments.


gulpfile.js
-----------

```javascript

var gulp = require('gulp');

require('gulp-task-list')(gulp);

// this task is a dummy task
gulp.task('some-task', function() {
console.log('this is some-task');
Expand Down Expand Up @@ -52,6 +52,28 @@ Ignore a task to be displayed
console.log('This task is private');
});
```


Explicitly describe files to be crawled for documentation
-----------------------------

```javascript

var gulp = require('gulp');

// array of files to be used for gulp tasks
var files = [
__filename,
'tests/gulp-tasks.js',
'gulp-tasks/prod.js',
'gulp-tasks/dev.js',
'gulp-tasks/infra.js',
'gulp-tasks/common.js'
];

require('gulp-task-list')(gulp, null, files);
```

command line
------------

Expand Down
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,11 @@ module.exports = function(gulp, ignoreTasks, files) {
console.log(table.toString());
});
};

function getCodeFromFiles(files) {
var codes = [];
files.forEach(function(file) {
codes.push(fs.readFileSync(file).toString());
});
return codes.join('\n');
}

0 comments on commit ffb02d9

Please sign in to comment.