diff --git a/README.md b/README.md index eb491b1..6f7984d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,15 @@ Library for turning strings and DOM nodes into virtual DOM nodes compatible with [Snabbdom](https://github.com/paldepind/snabbdom). -### Usage +## API + +### `virtualize(nodes, options)` +* `nodes: Element|String` - Either a DOM `Element` or a string of HTML to turn into a set of virtual DOM nodes. +* `options: Object` - A hash of options to pass into the virtualize call. Available options are currently: + * `context: Document` - An alternative DOM document to use (default is `window.document`). + * `hooks: Object` - An object specifying hooks to call during the virtualization process. See the [hooks](#hooks) section below. + +## Usage Add it to your application with @@ -34,7 +42,19 @@ let vnode = virtualize(topNode); // String -let vnode = virtualize('