Skip to content

Commit

Permalink
add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
bantic committed Jul 9, 2015
1 parent 6e57123 commit de20a98
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Mobiledoc DOM Renderer

This is a runtime renderer for the `mobiledoc` format.
It renders mobiledoc to DOM elements.

It is intended to be a small libraray that is run client-side in a browser that wants to display mobiledoc.

## Usage

```
var mobiledoc = [
[ // markers
['B']
],
[ // sections
[1, 'P', [ // array of markups
// markup
[
[0], // open markers (by index)
0, // close count
'hello world'
]
]
]
];
var renderer = new DOMRenderer();
var rendered = renderer.render(mobiledoc);
document.getElementById('output').appendChild(rendered);
// renders <div><p><b>hello world</b></b></div>
// into 'output' element
```

## Tests

* `npm test`

0 comments on commit de20a98

Please sign in to comment.