Skip to content

Commit 8aceeee

Browse files
author
reaganthomas
committed
added table of contents and changelog to readme
1 parent 9491e94 commit 8aceeee

File tree

1 file changed

+61
-20
lines changed

1 file changed

+61
-20
lines changed

README.md

Lines changed: 61 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,40 @@ Gulp Simple Task Loader
1414

1515
Easily modularize gulp tasks and minify your gulpfile. Works well with [gulp-load-plugins](https://www.npmjs.com/package/gulp-load-plugins).
1616

17-
## Installation
17+
* [Gulp Simple Task Loader](#gulp-simple-task-loader)
18+
* [Installation](#installation)
19+
* [Test](#test)
20+
* [Usage](#usage)
21+
* [Options](#options)
22+
* [Task Directory](#options-task-directory)
23+
* [Delimiters](#options-delimiters)
24+
* [Plugins](#options-plugins)
25+
* [Using gulp-load-plugins](#options-plugins-using-gulp-load-plugins)
26+
* [Passing in plugins manually](#options-plugins-passing-in-plugins-manually)
27+
* [Structuring a task](#structuring-a-task)
28+
* [Basic Tasks](#structuring-a-task-basic-tasks)
29+
* [Tasks with dependencies and/or parameters](#structuring-a-task-tasks-with-dependencies-and-or-parameters)
30+
* [Complete Examples](#complete-examples)
31+
* [Using gulp-load-plugins](#complete-examples-using-gulp-load-plugins)
32+
* [Parameterize tasks](#complete-examples-parameterize-tasks)
33+
* [Changelog](#changelog)
34+
35+
<h2 id="installation">Installation</h2>
1836

1937
```sh
20-
npm install gulp-simple-task-loader --save-dev
38+
$ npm install gulp-simple-task-loader --save-dev
2139
```
2240

23-
## Test
41+
<h2 id="test">Test</h2>
2442

25-
To test this package clone it and run the following command:
43+
To test this package clone it and run the following commands:
2644

2745
```sh
28-
npm test
46+
$ npm install
47+
$ npm test
2948
```
3049

31-
## Usage
50+
<h2 id="usage">Usage</h2>
3251

3352
```js
3453
var taskLoader = require('gulp-simple-task-loader');
@@ -37,7 +56,8 @@ taskLoader(options);
3756

3857
This will load and register tasks for all files defined in your `taskDirectory`.
3958

40-
## Options
59+
<h2 id="options">Options</h2>
60+
4161
You can pass in an options object as shown below. The values shown below are the defaults.
4262

4363
```js
@@ -50,11 +70,11 @@ taskLoader({
5070
});
5171
```
5272

53-
### Task Directory
73+
<h3 id="options-task-directory">Task Directory</h3>
5474

5575
Only put gulp tasks in your `taskDirectory`. All `.js` files in this directory will be attempted to be read as gulp tasks. Nested directories are supported as of `v1.0.29`.
5676

57-
### Delimiters
77+
<h3 id="options-delimiters">Delimiters</h3>
5878

5979
The purpose of the delimiters is to allow flexibility in task naming. A common convention for task names is to delimit using the `:` character, however `:`'s are not generally used or allowed in file names. A common usage of the delimiters is as follows:
6080

@@ -67,9 +87,9 @@ taskLoader({
6787

6888
These options would convert a filename such as `move-all.js` to a task with the name `move:all`.
6989

70-
### Plugins
90+
<h3 id="options-plugins">Plugins</h3>
7191

72-
##### Using gulp-load-plugins
92+
<h4 id="options-plugins-using-gulp-load-plugins">Using gulp-load-plugins</h4>
7393

7494
You can use [gulp-load-plugins](https://www.npmjs.com/package/gulp-load-plugins) to easily lazy-load your gulp plugins. Use gulp-load-plugins in conjunction with gulp-simple-task-loader to minimize your gulpfile.
7595

@@ -82,7 +102,7 @@ var plugins = require('gulp-load-plugins')();
82102
taskLoader({ plugins: plugins });
83103
```
84104

85-
##### Passing in plugins manually
105+
<h4 id="options-plugins-passing-in-plugins-manually">Passing in plugins manually</h4>
86106

87107
If not using gulp-load-plugins you must specify which plugins you want made available to your tasks.
88108

@@ -98,13 +118,13 @@ var plugins = {
98118
taskLoader({ plugins: plugins });
99119
```
100120

101-
## Structuring a task
121+
<h2 id="structuring-a-task">Structuring a task</h2>
102122

103123
All tasks should be functions that receive the parameters `gulp`, `config`, and `plugins`.
104124

105125
There are 2 ways to structure a task -- returning a function that executes the task, or returning an object that contains dependencies, parameters, and the function that executes the task.
106126

107-
### Basic tasks
127+
<h3 id="structuring-a-task-basic-tasks">Basic tasks</h3>
108128

109129
This is a typical function as you are used to with gulp.
110130

@@ -116,7 +136,7 @@ module.exports = function(gulp, config, plugins) {
116136
};
117137
```
118138

119-
### Tasks with dependencies
139+
<h3 id="structuring-a-task-tasks-with-dependencies-and-or-parameters">Tasks with dependencies and/or parameters</h3>
120140

121141
All 3 object keys (`deps`, `params`, and `fn`) are optional. This allows you to create a task that strictly calls other tasks, a task that is parameterized, or a task that just acts like a normal task.
122142

@@ -144,9 +164,9 @@ fn: function(param, cb) {} // where param is an item from the params array,
144164
// and cb is a callback to be called at the end of your function
145165
```
146166

147-
## Complete examples
167+
<h2 id="complete-examples">Complete examples</h2>
148168

149-
### Using gulp-load-plugins
169+
<h3 id="complete-examples-using-gulp-load-plugins">Using gulp-load-plugins</h3>
150170

151171
```js
152172
(gulpfile.js)
@@ -201,7 +221,7 @@ module.exports = function(gulp, config, plugins) {
201221
};
202222
```
203223

204-
### Parameterize tasks
224+
<h3 id="complete-examples-parameterize-tasks">Parameterize tasks</h3>
205225

206226
```js
207227
(gulpfile.js)
@@ -236,7 +256,28 @@ module.exports = function(gulp, config, plugins) {
236256
```
237257

238258
The task in `parameterized.js` would produce the following output:
239-
```bash
259+
```sh
240260
1
241261
2
242-
```
262+
```
263+
264+
<h2 id="changelog">Changelog</h2>
265+
266+
Documented below are any significant changes to the package.
267+
268+
* 1.x.x
269+
* 1.2.x
270+
* [1.2.1](https://github.com/reaganthomas/gulp-simple-task-loader/commit/767318e136aa7cb27925e73587487d11486ed50f) - added testing for `plugins` and `config` options
271+
* [1.2.0](https://github.com/reaganthomas/gulp-simple-task-loader/commit/768cc7e19488193a2171602a50e17c21f1cf9067) - restructured package to be more modular
272+
* 1.1.x
273+
* [1.1.6](https://github.com/reaganthomas/gulp-simple-task-loader/commit/0a042343adc2ee449e5a9e27dbc8fa01add9034b) - added documentation for testing the package
274+
* [1.1.4](https://github.com/reaganthomas/gulp-simple-task-loader/commit/3af56bd8353834d49a59f50ad49065be768e1e44) - improved documentation for parameterized tasks
275+
* [1.1.0](https://github.com/reaganthomas/gulp-simple-task-loader/commit/5b86eda1053ea077e9db02e40fb95ff09d2d7409) - added functionality to parameterize tasks - [github issue #9](https://github.com/reaganthomas/gulp-simple-task-loader/issues/9)
276+
* 1.0.x
277+
* [1.0.35](https://github.com/reaganthomas/gulp-simple-task-loader/commit/d78e36f06957b78e093a763ca3c3bef35559b3d2) - added support for coffeescript - [@chafnan](https://github.com/chafnan)
278+
* [1.0.33](https://github.com/reaganthomas/gulp-simple-task-loader/commit/b92f7211e292c76b90df0cff61359b0ac32a2948) - fixed [github issue #8](https://github.com/reaganthomas/gulp-simple-task-loader/issues/8)
279+
* [1.0.29](https://github.com/reaganthomas/gulp-simple-task-loader/commit/e0b9bf3e2a000c78955a96c61c14b73999ac615c) - added functionality to allow for recursive directory task searching
280+
* [1.0.17](https://github.com/reaganthomas/gulp-simple-task-loader/commit/e3d28d22ae085b2fd83ca914bfb3341962ab5f27) - added documentation for calling the plugin; added documentation for complete examples
281+
* [1.0.16](https://github.com/reaganthomas/gulp-simple-task-loader/commit/5ddc6f5b5735538169d1123df5299e2e1cb0f794) - created README.md
282+
* [1.0.15](https://github.com/reaganthomas/gulp-simple-task-loader/commit/0833009aefb217673891387916642c5ed1a53be9) - added dependency support for tasks
283+
* [1.0.14](https://github.com/reaganthomas/gulp-simple-task-loader/commit/e178e6ca2dfb5e571ea622cb56d5915ad7954e48) - implemented first set of tests

0 commit comments

Comments
 (0)