Skip to content

Commit

Permalink
Release 0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewmueller committed Nov 7, 2012
1 parent 6203f80 commit f97046f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
4 changes: 4 additions & 0 deletions History.md
@@ -1,4 +1,8 @@

0.0.2 / 2012-11-07
==================

* removed template support

0.0.1 / 10-21-2012
==================
Expand Down
27 changes: 10 additions & 17 deletions Readme.md
Expand Up @@ -2,12 +2,12 @@

Generic list component, based on the [menu component](https://github.com/component/menu).

Useful for creating inboxes, contact lists, etc.
Useful for creating inboxes, contact lists, etc.

![list example](http://f.cl.ly/items/0R073N0e1f0b0a390z3Y/Screen%20Shot%202012-10-21%20at%201.51.31%20PM.png)

![inbox example](http://f.cl.ly/items/0G091L250Q2c0n002b0b/Screen%20Shot%202012-10-21%20at%204.40.04%20PM.png)

## Installation

$ component install matthewmueller/list
Expand Down Expand Up @@ -43,9 +43,12 @@ Useful for creating inboxes, contact lists, etc.

```js
var List = require('list'),
inbox = new List;
inbox = new List,
hogan = require('matthewmueller-hogan'),
message = document.getElementById('message').text,
tpl = hogan.compile(message);

inbox.template(document.getElementById('message').text)
inbox.template(tpl)

var messages = [
{ from : 'jim', subject : 'hey', message : 'blah'},
Expand Down Expand Up @@ -80,7 +83,7 @@ inbox.add({
inbox.remove(3);
```

## API
## API

### List()

Expand All @@ -92,19 +95,9 @@ var list = new List(); // or...
var list = List();
```

### List#template(str)

Add a template string to be used when adding items. The default templating engine is [minstache](https://github.com/visionmedia/minstache).

```js
list.template('<li><a href={url}>{text}</a></li>')
```

You can use another templating engine by overwriting the engine attribute. If you'd like to use hogan.js, check out [matthewmueller/hogan](https://github.com/MatthewMueller/hogan)
### List#template(fn)

```js
list.engine = require('hogan');
```
Add a template `fn` to be used when adding items.

### List#add(arr | obj, [fn])

Expand Down
2 changes: 1 addition & 1 deletion component.json
Expand Up @@ -2,7 +2,7 @@
"name": "list",
"repo": "matthewmueller/list",
"description": "Generic list component",
"version": "0.0.1",
"version": "0.0.2",
"keywords": [],
"dependencies": {
"component/jquery" : "*",
Expand Down

0 comments on commit f97046f

Please sign in to comment.