Skip to content

Commit d693e49

Browse files
SomethingNew71phated
authored andcommitted
Docs: Add front-matter to each file (#2109)
1 parent 86acdea commit d693e49

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+332
-20
lines changed

Diff for: docs/API.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!-- front-matter
2+
id: api
3+
title: API
4+
hide_title: true
5+
sidebar_label: API
6+
-->
7+
18
Note: these docs are for version v4.0.0 (aka `gulp@next`) If you're on gulp
29
v3.9.1, which is the current default `npm` release, you probably want [that
310
version's documentation](https://github.com/gulpjs/gulp/blob/v3.9.1/docs/API.md).

Diff for: docs/CLI.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!-- front-matter
2+
id: cli
3+
title: CLI
4+
hide_title: true
5+
sidebar_label: CLI
6+
-->
7+
18
## gulp CLI docs
29

310
### Flags
@@ -105,7 +112,7 @@ Output:
105112

106113
Command: `gulp --tasks-simple`
107114

108-
Output:
115+
Output:
109116
```shell
110117
one
111118
two

Diff for: docs/FAQ.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!-- front-matter
2+
id: faq
3+
title: FAQ
4+
hide_title: true
5+
sidebar_label: FAQ
6+
-->
7+
18
# FAQ
29

310
## Why gulp? Why not ____?

Diff for: docs/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!-- front-matter
2+
id: docs
3+
title: Docs
4+
hide_title: true
5+
sidebar_label: Docs
6+
-->
7+
18
# gulp documentation
29

310
* [Getting Started](getting-started.md) - Get started with gulp

Diff for: docs/getting-started.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!-- front-matter
2+
id: getting-started
3+
title: Getting Started
4+
hide_title: true
5+
sidebar_label: Getting Started
6+
-->
7+
18
# Getting Started
29

310
*If you've previously installed gulp globally, run `npm rm --global gulp` before following these instructions.* For more information, read this [Sip](https://medium.com/gulpjs/gulp-sips-command-line-interface-e53411d4467).

Diff for: docs/recipes/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!-- front-matter
2+
id: recipes
3+
title: Recipes
4+
hide_title: true
5+
sidebar_label: Recipes
6+
-->
7+
18
# Recipes
29

310
* [Automate release workflow](automate-release-workflow.md)

Diff for: docs/recipes/automate-release-workflow.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!-- front-matter
2+
id: automate-release-workflow
3+
title: Automate Release Workflow
4+
hide_title: true
5+
sidebar_label: Automate Release Workflow
6+
-->
7+
18
# Automate release workflow
29

310
If your project follows a semantic versioning, it may be a good idea to automatize the steps needed to do a release.

Diff for: docs/recipes/browserify-multiple-destination.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!-- front-matter
2+
id: browserify-multiple-destination
3+
title: Browserify w/ Multiple Destinations
4+
hide_title: true
5+
sidebar_label: Browserify w/ Multiple Destinations
6+
-->
7+
18
# Browserify + Globs (multiple destination)
29

310
This example shows how to set up a task of bundling multiple entry points into multiple destinations using browserify.

Diff for: docs/recipes/browserify-transforms.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!-- front-matter
2+
id: browserify-transforms
3+
title: Browserify + Transforms
4+
hide_title: true
5+
sidebar_label: Browserify + Transforms
6+
-->
7+
18
# Browserify + Transforms
29

310
[Browserify](https://github.com/browserify/browserify) has become an important and indispensable

Diff for: docs/recipes/browserify-uglify-sourcemap.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
<!-- front-matter
2+
id: browserify-uglify-sourcemap
3+
title: Browserify + Uglify2 with Sourcemaps
4+
hide_title: true
5+
sidebar_label: Browserify + Uglify2 with Sourcemaps
6+
-->
7+
18
# Browserify + Uglify2 with sourcemaps
29

310
[Browserify](https://github.com/browserify/browserify) has become an important and indispensable
411
tool but requires being wrapped before working well with gulp. Below is a simple recipe for using
512
Browserify with full sourcemaps that resolve to the original individual files.
613

7-
See also: the [Combining Streams to Handle Errors](https://github.com/gulpjs/gulp/blob/master/docs/recipes/combining-streams-to-handle-errors.md) recipe for handling errors with browserify or uglify in your stream.
14+
See also: the [Combining Streams to Handle Errors](https://github.com/gulpjs/gulp/blob/master/docs/recipes/combining-streams-to-handle-errors.md) recipe for handling errors with browserify or uglify in your stream.
815

916
A simple `gulpfile.js` file for Browserify + Uglify2 with sourcemaps:
1017

Diff for: docs/recipes/browserify-with-globs.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!-- front-matter
2+
id: browserify-with-globs
3+
title: Browserify + Globs
4+
hide_title: true
5+
sidebar_label: Browserify + Globs
6+
-->
7+
18
# Browserify + Globs
29

310
[Browserify + Uglify2](https://github.com/gulpjs/gulp/blob/master/docs/recipes/browserify-uglify-sourcemap.md) shows how to setup a basic gulp task to bundle a JavaScript file with its dependencies, and minify the bundle with UglifyJS while preserving source maps.

Diff for: docs/recipes/combining-streams-to-handle-errors.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!-- front-matter
2+
id: combining-streams-to-handle-errors
3+
title: Combining Streams to Handle Errors
4+
hide_title: true
5+
sidebar_label: Combining Streams to Handle Errors
6+
-->
7+
18
# Combining streams to handle errors
29

310
By default, emitting an error on a stream will cause it to be thrown unless it already has a listener attached to the `error` event. This gets a bit tricky when you're working with longer pipelines of streams.

Diff for: docs/recipes/cron-task.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1+
<!-- front-matter
2+
id: cron-task
3+
title: Cron Task
4+
hide_title: true
5+
sidebar_label: Cron Task
6+
-->
7+
18
# Run gulp task via cron job
29

310
While logged in via a user that has privileges to run `gulp`, run the following:
411

512
crontab -e
6-
13+
714
to edit your current "[crontab](https://en.wikipedia.org/wiki/Cron)" file.
815

916
Typically, within a cron job, you want to run any binary using absolute paths,

Diff for: docs/recipes/delete-files-folder.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<!-- front-matter
2+
id: delete-files-folder
3+
title: Delete files and folders
4+
hide_title: true
5+
sidebar_label: Delete files and folders
6+
-->
17

28
# Delete files and folders
39

Diff for: docs/recipes/exports-as-tasks.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!-- front-matter
2+
id: export-as-tasks
3+
title: Export as Tasks
4+
hide_title: true
5+
sidebar_label: Export as Tasks
6+
-->
7+
18
# Exports as Tasks
29

310
Using the ES2015 module syntax you can use your exports as tasks.

Diff for: docs/recipes/fast-browserify-builds-with-watchify.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!-- front-matter
2+
id: fast-browserify-builds-with-watchify
3+
title: Fast Browserify builds with Watchify
4+
hide_title: true
5+
sidebar_label: Fast Browserify builds with Watchify
6+
-->
7+
18
# Fast browserify builds with watchify
29

310
As a [browserify](https://github.com/browserify/browserify) project begins to expand, the time to bundle it slowly gets longer and longer. While it might start at 1 second, it's possible to be waiting 30 seconds for your project to build on particularly large projects.
@@ -24,7 +31,7 @@ var customOpts = {
2431
debug: true
2532
};
2633
var opts = assign({}, watchify.args, customOpts);
27-
var b = watchify(browserify(opts));
34+
var b = watchify(browserify(opts));
2835

2936
// add transformations here
3037
// i.e. b.transform(coffeeify);

Diff for: docs/recipes/handling-the-delete-event-on-watch.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!-- front-matter
2+
id: handling-the-delete-event-on-watch
3+
title: Handling the Delete Event on Watch
4+
hide_title: true
5+
sidebar_label: Handling the Delete Event on Watch
6+
-->
7+
18
# Handling the Delete Event on Watch
29

310
You can listen for `'unlink'` events to fire on the watcher returned from `gulp.watch`.

Diff for: docs/recipes/incremental-builds-with-concatenate.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!-- front-matter
2+
id: incremental-builds-with-concatenate
3+
title: Incremental Rebuilding
4+
hide_title: true
5+
sidebar_label: Incremental Rebuilding
6+
-->
7+
18
# Incremental rebuilding, including operating on full file sets
29

310
The trouble with incremental rebuilds is you often want to operate on _all_ processed files, not just single files. For example, you may want to lint and module-wrap just the file(s) that have changed, then concatenate it with all other linted and module-wrapped files. This is difficult without the use of temp files.

Diff for: docs/recipes/maintain-directory-structure-while-globbing.md

+14-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1+
<!-- front-matter
2+
id: maintain-directory-structure-while-globbing
3+
title: Maintain Directory Structure while Globbing
4+
hide_title: true
5+
sidebar_label: Maintain Directory Structure while Globbing
6+
-->
7+
18
# Maintain Directory Structure while Globbing
29

310
If you are planning to read a few files/folders from a directory and maintain their relative path, you need to pass `{base: '.'}` as the second argument to `gulp.src()`.
411

512

6-
For example, if you have a directory structure like
13+
For example, if you have a directory structure like
714

815
![Dev setup](https://cloud.githubusercontent.com/assets/2562992/3178498/bedf75b4-ec1a-11e3-8a71-a150ad94b450.png)
916

@@ -27,18 +34,17 @@ If you want to maintain the structure, you need to pass `{base: '.'}` to `gulp.s
2734

2835
```js
2936
gulp.task('task', function () {
30-
return gulp.src(['index.html',
31-
'css/**',
32-
'js/**',
33-
'lib/**',
34-
'images/**',
37+
return gulp.src(['index.html',
38+
'css/**',
39+
'js/**',
40+
'lib/**',
41+
'images/**',
3542
'plugin/**'
3643
], {base: '.'})
3744
.pipe(operation1())
3845
.pipe(operation2());
3946
});
4047
```
41-
And the input to your `operation1()` will be a folder structure like
48+
And the input to your `operation1()` will be a folder structure like
4249

4350
![with-base](https://cloud.githubusercontent.com/assets/2562992/3178607/053d6722-ec1c-11e3-9ba8-7ce39e1a480e.png)
44-

Diff for: docs/recipes/make-stream-from-buffer.md

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!-- front-matter
2+
id: make-stream-from-buffer
3+
title: Make Stream from Buffer
4+
hide_title: true
5+
sidebar_label: Make Stream from Buffer
6+
-->
7+
18
# Make stream from buffer (memory contents)
29

310
Sometimes you may need to start a stream with files that their contents are in a variable and not in a physical file. In other words, how to start a 'gulp' stream without using `gulp.src()`.
@@ -78,9 +85,9 @@ gulp.task('write-versions', function() {
7885
availableVersions.forEach(function(v) {
7986
// make a new stream with fake file name
8087
var stream = source('final.' + v);
81-
88+
8289
var streamEnd = stream;
83-
90+
8491
// we load the data from the concatenated libs
8592
var fileContents = memory['libs.concat.js'] +
8693
// we add the version's data
@@ -99,11 +106,11 @@ gulp.task('write-versions', function() {
99106
.pipe(vinylBuffer())
100107
//.pipe(tap(function(file) { /* do something with the file contents here */ }))
101108
.pipe(gulp.dest('output'));
102-
109+
103110
// add the end of the stream, otherwise the task would finish before all the processing
104111
// is done
105112
streams.push(streamEnd);
106-
113+
107114
});
108115

109116
return es.merge.apply(this, streams);

Diff for: docs/recipes/minified-and-non-minified.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!-- front-matter
2+
id: minified-and-non-minified
3+
title: Outputting Minified and non-minified
4+
hide_title: true
5+
sidebar_label: Outputting Minified and non-minified
6+
-->
7+
18
# Output both a minified and non-minified version
29

310
Outputting both a minified and non-minified version of your combined JavaScript files can be achieved by using `gulp-rename` and piping to `dest` twice (once before minifying and once after minifying):

Diff for: docs/recipes/minimal-browsersync-setup-with-gulp4.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!-- front-matter
2+
id: minimal-browsersync-setup-with-gulp4
3+
title: Minimal BrowserSync setup with Gulp 4
4+
hide_title: true
5+
sidebar_label: Minimal BrowserSync setup with Gulp 4
6+
-->
7+
18
# Minimal BrowserSync setup with Gulp 4
29

310
[BrowserSync](https://www.browsersync.io/) is a great tool to streamline

Diff for: docs/recipes/mocha-test-runner-with-gulp.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!-- front-matter
2+
id: mocha-test-runner-with-gulp
3+
title: Mocha test-runner with Gulp
4+
hide_title: true
5+
sidebar_label: Mocha test-runner with Gulp
6+
-->
7+
18
# Mocha test-runner with gulp
29

310
### Passing shared module in all tests

Diff for: docs/recipes/only-pass-through-changed-files.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!-- front-matter
2+
id: only-pass-through-changed-files
3+
title: Only Pass Through Changed Files
4+
hide_title: true
5+
sidebar_label: Only Pass Through Changed Files
6+
-->
7+
18
# Only pass through changed files
29

310
Files are passed through the whole pipe chain on every run by default. By using [gulp-changed](https://github.com/sindresorhus/gulp-changed) only changed files will be passed through. This can speed up consecutive runs considerably.

Diff for: docs/recipes/pass-arguments-from-cli.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!-- front-matter
2+
id: pass-arguments-from-cli
3+
title: Pass Arguments from the CLI
4+
hide_title: true
5+
sidebar_label: Pass Arguments from the CLI
6+
-->
7+
18
# Pass arguments from the command line
29

310
```js

Diff for: docs/recipes/rebuild-only-files-that-change.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!-- front-matter
2+
id: rebuild-only-files-that-change
3+
title: Rebuild only files that Change
4+
hide_title: true
5+
sidebar_label: Rebuild only files that Change
6+
-->
7+
18
# Rebuild only files that change
29

310
With [`gulp-watch`](https://github.com/floatdrop/gulp-watch):

Diff for: docs/recipes/rollup-with-rollup-stream.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!-- front-matter
2+
id: rollup-with-rollup-stream
3+
title: Rollup with Rollup-Stream
4+
hide_title: true
5+
sidebar_label: Rollup with Rollup-Stream
6+
-->
7+
18
# Rollup with rollup-stream
29

310
Like Browserify, [Rollup](https://rollupjs.org/) is a bundler and thus only fits naturally into gulp if it's at the start of the pipeline. Unlike Browserify, Rollup doesn't natively produce a stream as output and needs to be wrapped before it can take this position. [rollup-stream](https://github.com/Permutatrix/rollup-stream) does this for you, producing output just like that of Browserify's `bundle()` method&mdash;as a result, most of the Browserify recipes here will also work with rollup-stream.

0 commit comments

Comments
 (0)