Skip to content

Commit 42d5569

Browse files
committed
Prettify build.md
1 parent 96fa656 commit 42d5569

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

build.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,19 @@ mfunc().ordinal({ N: 1 })
2020
// "The 1st message."
2121

2222
var efunc = new Function('return (' + mfunc.toString() + ')()');
23-
efunc()
23+
24+
efunc();
2425
// { simple: [Function],
2526
// var: [Function],
2627
// plural: [Function],
2728
// select: [Function],
2829
// ordinal: [Function] }
2930

30-
efunc().ordinal({N:2})
31+
efunc().ordinal({ N: 2 });
3132
// "The 2nd message."
3233
```
3334

34-
Note that as `efunc` is defined as a `new Function()`, it has no access to the surrounding scope; the output of `mfunc().toString()` can be saved as a file and later included with `require()` or `<script src=...>`, providing access to the compiled functions that is completely independent of messageformat.js, or any other dependencies.
35+
Note that as `efunc` is defined as a `new Function()`, it has no access to the surrounding scope. This means that the output of `mfunc().toString()` can be saved as a file and later included with `require()` or `<script src=...>`, providing access to the compiled functions completely independently of messageformat.js, or any other dependencies.
3536

3637

3738
## CLI Compiler
@@ -70,7 +71,7 @@ $ messageformat -l en ./example/en
7071
With default options, compiled messageformat functions are available through the `i18n` global object, with each source json having a corresponding subobject. Hence the compiled function corresponding to the `test` message defined in [`example/en/sub/folder/plural.json`](https://github.com/messageformat/messageformat.js/tree/master/example/en/sub/folder/plural.json) is available as [`i18n['sub/folder/plural'].plural`](https://github.com/messageformat/messageformat.js/tree/master/example/en/i18n.js):
7172

7273
```html
73-
<script src="path/to/bower_components/messageformat/example/en/i18n.js"></script>
74+
<script src="path/to/messageformat/example/en/i18n.js"></script>
7475
<script>
7576
console.log(i18n['sub/folder/plural'].plural({NUM: 3}));
7677
</script>

0 commit comments

Comments
 (0)