Skip to content
This repository was archived by the owner on May 7, 2024. It is now read-only.

Commit aad4045

Browse files
authored
Merge pull request NightlyCommit#10 from ericmorand/issue_9
Fix issue NightlyCommit#9
2 parents 740d160 + fb1a699 commit aad4045

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

README.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Twing loader
1+
# twing-loader
22
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage percentage][coveralls-image]][coveralls-url]
33

4-
Webpack loader that compiles Twig templates with [Twing](https://www.npmjs.com/package/twing).
4+
Webpack loader that compiles Twig templates using [Twing](https://www.npmjs.com/package/twing).
55

66
## Prerequisites
77

@@ -20,7 +20,7 @@ twing-loader comes with two available behaviors. Depending on your need, you can
2020

2121
By default, twing-loader transforms a Twig template to a function that, when called with some optional data, renders the template:
2222

23-
> webpack.config.js
23+
<sub>webpack.config.js</sub>
2424

2525
```javascript
2626
module.exports = {
@@ -44,7 +44,7 @@ module.exports = {
4444
}
4545
```
4646

47-
> environment.js
47+
<sub>environment.js</sub>
4848

4949
```javascript
5050
const {TwingEnvironment, TwingLoaderRelativeFilesystem} = require("twing");
@@ -54,13 +54,13 @@ module.exports = new TwingEnvironment(
5454
);
5555
```
5656

57-
> index.twig
57+
<sub>index.twig</sub>
5858

5959
```twig
6060
{{ foo }}
6161
```
6262

63-
> index.js
63+
<sub>index.js</sub>
6464

6565
```javascript
6666
let template = require('./index.twig');
@@ -70,13 +70,13 @@ let renderedTemplate = template({
7070
}); // "bar"
7171
```
7272

73-
This behavior, known as _render at runtime_, comes at the price of having Twing as part of the bundle.
73+
This behavior, known as _render at runtime_, comes at the cost of having Twing as part of the bundle.
7474

7575
### Render at compile time
7676

7777
When `renderContext` is _defined_, twing-loader transforms a Twig template to the result of the template rendering:
7878

79-
> webpack.config.js
79+
<sub>webpack.config.js</sub>
8080

8181
```javascript
8282
module.exports = {
@@ -103,7 +103,7 @@ module.exports = {
103103
}
104104
```
105105

106-
> environment.js
106+
<sub>environment.js</sub>
107107

108108
```javascript
109109
const {TwingEnvironment, TwingLoaderRelativeFilesystem} = require("twing");
@@ -113,13 +113,13 @@ module.exports = new TwingEnvironment(
113113
);
114114
```
115115

116-
> index.twig
116+
<sub>index.twig</sub>
117117

118118
```twig
119119
{{ foo }}
120120
```
121121

122-
> index.js
122+
<sub>index.js</sub>
123123

124124
```javascript
125125
let renderedTemplate = require('./index.twig'); // "bar"
@@ -131,7 +131,7 @@ This second behavior, known as _render at compile time_, comes with the benefit
131131

132132
|Name|Required|Type|Default|Description|
133133
|---|:---:|:---:|:---:|---|
134-
|environmentModulePath|`true`|string|`undefined`| A path to the module that exports the `TwingEnvironment` instance that will be used by the loader to compile (and render) the templates at compile-time and by the bundle to render them at runtime.|
134+
|environmentModulePath|`true`|string|`undefined`| A path to the module that exports the `TwingEnvironment` instance that will be used by the loader to compile (and render) the templates at compile time and by the bundle to render them at runtime.|
135135
|renderContext|`false`|any|`undefined`|If different from `undefined`, enables the _render at compile time_ behavior and serves as context for the rendering of the templates.|
136136

137137
## Contributing

0 commit comments

Comments
 (0)