Skip to content

Commit 961432d

Browse files
author
Eli Skeggs
committed
style(docs): apply prettier to readme
1 parent 1b58ad2 commit 961432d

File tree

1 file changed

+28
-29
lines changed

1 file changed

+28
-29
lines changed

README.md

+28-29
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
Features:
66

7-
* Import Handlebars templates as ES6 modules
8-
* Support for Handlebars [helpers](#helpers) and partials
9-
* [Precompiles](http://handlebarsjs.com/precompilation.html) templates so your application only needs the Handlebars runtime
10-
* Handlebars runtime [included](#handlebars)
11-
* Optional rendering to [jQuery collections](#jquery) vs. raw strings
7+
- Import Handlebars templates as ES6 modules
8+
- Support for Handlebars [helpers](#helpers) and partials
9+
- [Precompiles](http://handlebarsjs.com/precompilation.html) templates so your application only needs the Handlebars runtime
10+
- Handlebars runtime [included](#handlebars)
11+
- Optional rendering to [jQuery collections](#jquery) vs. raw strings
1212

1313
## Installation
1414

@@ -31,15 +31,14 @@ var rollup = require('rollup');
3131
var handlebars = require('rollup-plugin-handlebars-plus');
3232
var rootImport = require('rollup-plugin-root-import');
3333

34-
3534
var partialRoots = [`${__dirname}/src/client/js/views/`, `${__dirname}/src/common/views/`];
3635

3736
rollup({
3837
entry: 'main.js',
3938
plugins: [
4039
// Required by use of `partialRoot` below.
4140
rootImport({
42-
root: partialRoots
41+
root: partialRoots,
4342
}),
4443
handlebars({
4544
handlebars: {
@@ -55,8 +54,8 @@ rollup({
5554
// Options to pass to Handlebars' `parse` and `precompile` methods.
5655
options: {
5756
// Whether to generate sourcemaps for the templates
58-
sourceMap: true // Default: true
59-
}
57+
sourceMap: true, // Default: true
58+
},
6059
},
6160

6261
// The ID(s) of modules to import before every template, see the "Helpers" section below.
@@ -74,10 +73,10 @@ rollup({
7473
partialRoot: partialRoots, // Default: none
7574

7675
// The module ID of jQuery, see the "jQuery" section below.
77-
jquery: 'jquery' // Default: none
78-
})
79-
]
80-
})
76+
jquery: 'jquery', // Default: none
77+
}),
78+
],
79+
});
8180
```
8281

8382
lets you do this:
@@ -114,16 +113,16 @@ rollup({
114113
entry: 'main.js',
115114
plugins: [
116115
handlebars({
117-
helpers: ['/utils/HandlebarsHelpers.js']
118-
})
119-
]
120-
})
116+
helpers: ['/utils/HandlebarsHelpers.js'],
117+
}),
118+
],
119+
});
121120
```
122121

123122
```js
124123
// /utils/HandlebarsHelpers.js
125-
export default function(Handlebars) {
126-
Handlebars.registerHelper('encodeURIComponent', function(text) {
124+
export default function (Handlebars) {
125+
Handlebars.registerHelper('encodeURIComponent', function (text) {
127126
return new Handlebars.SafeString(encodeURIComponent(text));
128127
});
129128
}
@@ -168,9 +167,9 @@ rollup({
168167
commonjs({
169168
include: 'node_modules/**',
170169
}),
171-
handlebars()
172-
]
173-
})
170+
handlebars(),
171+
],
172+
});
174173
```
175174

176175
In case you need the default runtime ID, it's available as `handlebars.runtimeId`. This might be
@@ -192,8 +191,8 @@ import Template from './index.html';
192191
var MyView = Backbone.View.extend({
193192
render() {
194193
this.setElement(Template());
195-
}
196-
})
194+
},
195+
});
197196
```
198197

199198
or by customizing the template using jQuery's APIs:
@@ -206,7 +205,7 @@ var tooltip = TooltipTemplate();
206205

207206
tooltip.css({
208207
left: 50,
209-
top: 100
208+
top: 100,
210209
});
211210

212211
$('body').append(tooltip);
@@ -223,10 +222,10 @@ rollup({
223222
entry: 'main.js',
224223
plugins: [
225224
handlebars({
226-
jquery: 'jquery'
227-
})
228-
]
229-
})
225+
jquery: 'jquery',
226+
}),
227+
],
228+
});
230229
```
231230

232231
Curious about how to ID jQuery when it's a global i.e. you're _not_ bundling it?

0 commit comments

Comments
 (0)