Skip to content

Commit 7a48ca2

Browse files
committed
update readme format and indentation.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
1 parent f584493 commit 7a48ca2

File tree

2 files changed

+21
-22
lines changed

2 files changed

+21
-22
lines changed

README.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
55
Follow [@browserSync](http://www.twitter.com/browserSync) for news & updates.
66

7-
##About
7+
## About
88

99
For a full list of features, please visit [https://github.com/shakyShane/browser-sync](https://github.com/shakyShane/browser-sync)
1010

11-
##Usage
11+
## Usage
1212

1313
First, install `browser-sync` as a development dependency:
1414

@@ -25,39 +25,38 @@ var browserSync = require('browser-sync');
2525
// Static server
2626
gulp.task('browser-sync', function() {
2727
browserSync.init(null, {
28-
server: {
29-
baseDir: "./"
30-
}
28+
server: {
29+
baseDir: "./"
30+
}
3131
});
3232
});
3333

34-
3534
// or...
3635

37-
3836
// Proxy to existing vhost (version 0.7.0 & greater)
3937
gulp.task('browser-sync', function() {
4038
browserSync.init(null, {
41-
proxy: "yourlocal.dev"
39+
proxy: "yourlocal.dev"
4240
});
4341
});
4442

4543
// Proxy to existing vhost (before version 0.7.0) * Seriously? time to upgrade.
4644
gulp.task('browser-sync', function() {
4745
browserSync.init(null, {
48-
proxy: {
49-
host: "yourlocal.dev",
50-
port: 80
51-
}
46+
proxy: {
47+
host: "yourlocal.dev",
48+
port: 80
49+
}
5250
});
5351
});
54-
5552
```
53+
5654
There's a [full list of available options](https://github.com/shakyShane/browser-sync/wiki/Working-with-a-Config-File) on the module's repo.
5755

58-
##NOTE: at least version 0.8.0 is required for the following examples!##
56+
## NOTE: at least version 0.8.0 is required for the following examples! ##
57+
58+
### Auto reload & CSS injecting
5959

60-
###Auto reload & CSS injecting
6160
Streams are now supported in BrowserSync, so you can call `reload` when all your tasks are complete & all browsers will be informed of the changes.
6261

6362
**Gulp + SASS + CSS Injecting**
@@ -90,13 +89,14 @@ gulp.task('sass', function () {
9089
gulp.task('default', ['sass', 'browser-sync'], function () {
9190
gulp.watch("scss/*.scss", ['sass']);
9291
});
93-
9492
```
93+
9594
**SASS & Source Maps**
9695

9796
If you use [gulp-ruby-sass](https://www.npmjs.org/package/gulp-ruby-sass) with `sourcemap: true` option `*.css.map` file/files will be generated and after css injection browser will be reloaded. To prevent refreshing page after css injection use [gulp-filter](https://www.npmjs.org/package/gulp-filter) package.
9897

9998
For example:
99+
100100
```js
101101
//other necessary packages
102102
var filter = require('gulp-filter');
@@ -108,15 +108,14 @@ gulp.task('sass', function () {
108108
.pipe(filter('**/*.css')) // Filtering stream to only css files
109109
.pipe(browserSync.reload({stream:true}));
110110
});
111-
112111
```
112+
113113
**Browser Reloading**
114114

115115
Sometimes you might just want to reload the page completely (for example, after processing a bunch of JS files) - you can do that
116116
by passing `once` as an option. This will stop `reload` being call multiple times.
117117

118118
```js
119-
120119
// start server
121120
gulp.task('browser-sync', function() {
122121
browserSync.init(null, {
@@ -174,14 +173,14 @@ gulp.task('default', ['browser-sync'], function () {
174173
gulp.watch("scss/*.scss", ['sass']);
175174
gulp.watch("*.html", ['bs-reload']);
176175
});
177-
178176
```
179177

180-
###Screencasts
178+
### Screencasts
179+
181180
Coming soon. If you want to see anything specific covered in the screencasts, please ask me [@shaneOsbourne](https://www.twitter.com/shaneosbourne)
182181

182+
## Support
183183

184-
##Support
185184
If you've found Browser-sync useful and would like to contribute to its continued development & support, please feel free to send a donation of any size - it would be greatly appreciated!
186185

187186
[![Support via Gittip](https://rawgithub.com/chris---/Donation-Badges/master/gittip.jpeg)](https://www.gittip.com/shakyshane)

gulpfile-example-API.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ gulp.task('browser-sync', function () {
2525
gulp.task('default', ['browser-sync'], function () {
2626
gulp.watch('css/*.css', function (file) {
2727
if (file.type === "changed") {
28-
browserSync.reload(file.path);
28+
browserSync.reload(file.path);
2929
}
3030
});
3131
});

0 commit comments

Comments
 (0)