Skip to content

Commit

Permalink
Merge pull request galaxykate#1 from dariusk/patch-1
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
v21 committed Nov 30, 2015
2 parents 26148c5 + 72ad6d9 commit bdaab7b
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,33 @@
Tracery: a story-grammar generation library for javascript

This is my attempt to package up [Tracery](https://github.com/galaxykate/tracery/) as a Node library.

## Installation

This is not hosted on [npmjs.org](http://npmjs.org) but you can install any node module directly from a Github repository using npm on the command line:

```bash
$ npm install v21/tracery --save
```

## Example usage

```javascript
var tracery = require('tracery-grammar');

var grammar = tracery.createGrammar({
'animal': ['panda','fox','capybara','iguana'],
'emotion': ['sad','happy','angry','jealous'],
'origin':['I am #emotion.a# #animal#.'],
});

console.log(grammar.flatten('#origin#'));
```

Sample output:

```plaintext
I am a happy iguana.
I am an angry fox.
I am a sad capybara.
```

0 comments on commit bdaab7b

Please sign in to comment.