Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
bantic committed Nov 24, 2015
1 parent 78b27a3 commit f26ee5d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
## Mobiledoc DOM Renderer [![Build Status](https://travis-ci.org/bustlelabs/mobiledoc-dom-renderer.svg?branch=master)](https://travis-ci.org/bustlelabs/mobiledoc-dom-renderer)

This is a DOM renderer for the [Mobiledoc](https://github.com/bustlelabs/mobiledoc-kit/blob/master/MOBILEDOC.md) format used
This is a DOM renderer for the [Mobiledoc format](https://github.com/bustlelabs/mobiledoc-kit/blob/master/MOBILEDOC.md) used
by [Mobiledoc-Kit](https://github.com/bustlelabs/mobiledoc-kit).

To learn more about Mobiledoc cards and renderers, see the **[Mobiledoc Cards docs](https://github.com/bustlelabs/mobiledoc-kit/blob/master/CARDS.md)**.

The renderer is a small library intended for use in browser clients.

### Usage
Expand Down Expand Up @@ -35,13 +37,13 @@ document.getElementById('output').appendChild(result);
```

The Renderer constructor accepts a single object with the following optional properties:
* `cards`: An array of card objects
* `cardOptions`: Options to pass to cards when they are rendered
* `unknownCardHandler`: A method that will be called when any unknown card is enountered
* `cards` [array] - The list of card objects that the renderer may encounter in the mobiledoc
* `cardOptions` [object] - Options to pass to cards when they are rendered
* `unknownCardHandler` [function] - Will be called when any unknown card is enountered

The return value from `renderer.render(mobiledoc)` is an object with two properties:
* `result` The rendered result. A DOMNode
* `teardown` A teardown method that, when called, will tear down the rendered mobiledoc and call any teardown handlers that were registered by cards in the mobiledoc.
* `result` [DOM Node] - The rendered result
* `teardown` [function] - When called, this function will tear down the rendered mobiledoc and call any teardown handlers that were registered by cards when they were rendererd

### Tests

Expand Down

0 comments on commit f26ee5d

Please sign in to comment.