Skip to content

Commit

Permalink
Update readme (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
ismay authored Jan 1, 2017
1 parent 427055e commit b7f93dd
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@

> A metalsmith plugin for in-place templating
This plugin allows you to render templates. The default templating engine is
[jstransformer](https://github.com/jstransformers/jstransformer), but you can use any engine you
like. For support questions please use [stack overflow][stackoverflow-url] or our
[slack channel][slack-url].
This plugin allows you to render templates. For support questions please use
[stack overflow][stackoverflow-url] or our [slack channel][slack-url].

## Installation

Expand All @@ -24,15 +22,16 @@ You can pass options to `metalsmith-in-place` with the
[Javascript API](https://github.com/segmentio/metalsmith#api) or
[CLI](https://github.com/segmentio/metalsmith#cli). The options are:

* `engine`: the engine that will be used for processing files (optional, default: jstransformer)
* `engine`: the engine that will be used for processing files (optional, default:
[jstransformer](https://github.com/superwolff/metalsmith-engine-jstransformer))
* `engineOptions`: an object with options that will be passed to the engine (optional, default: `{}`)
* `pattern`: only files that match this pattern will be processed (optional, default: `**`)

### engine

The engine that will be used to process files. The default engine is
[jstransformer](https://github.com/jstransformers/jstransformer), but any compatible engine can be
used. To select a different engine you must use metalsmith's
[jstransformer](https://github.com/superwolff/metalsmith-engine-jstransformer), but any compatible
engine can be used. To select a different engine you must use metalsmith's
[Javascript API](https://github.com/segmentio/metalsmith#api) like so:

```javascript
Expand All @@ -44,6 +43,9 @@ metalsmith(__dirname)
.use(inPlace({
engine: Consolidate
}))
.build(function(err){
if (err) throw err;
});
```

This would use consolidate to process files. See each engine's documentation for options and
Expand All @@ -63,9 +65,12 @@ metalsmith(__dirname)
"cache": false
}
}))
.build(function(err){
if (err) throw err;
});
```

Would pass the `engineOptions` object `{ "cache": false }` to the selected engine.
Would pass `{ "cache": false }` to the selected engine.

### pattern

Expand All @@ -79,6 +84,9 @@ metalsmith(__dirname)
.use(inPlace({
pattern: "**/*.hbs"
}))
.build(function(err){
if (err) throw err;
});
```

Would only process files that have the `.hbs` extension.
Expand Down

0 comments on commit b7f93dd

Please sign in to comment.