# identify.js

Generate `id` attributes for HTML block elements.

## Usage

```javascript
var identify = require('identify');
var html = "<h1>The Wizard of Oz</h1><p>The morning after the balloon</p>";
console.log(identify(html));
// <h1 id="the-wizard-of-oz">The Wizard of Oz</h1><p id="the-morning-after">The morning after the balloon</p>
```

For a more complete example, see [gh-pages/example][], e.g. deep-linking to the
[first blockquote][blockquote].

## Install

    npm install identify

## Options

Pass an extra object to `identify()` to set options. The defaults are:

```javascript
{
  block_elements: block_elements,
  anchor: false
}
```

* `block_elements`: a list of elements to add `id` attributes to. Defaults to
  all HTML(5) block elements, as specified by the [Mozilla Developer
  Network][moz].

* `anchor`: prepend an anchor to each element, for example:

        <h1 id="the-wizard-of-oz"><a href="#the-wizard-of-oz" class="anchor"></a>The Wizard of Oz</h1>

## Author

Copyright 2012 Tom Vincent <http://tlvince.com/contact>

## License

Released under the [MIT License][license].

  [moz]: https://developer.mozilla.org/en-US/docs/HTML/Block-level_elements
  [license]: http://tlvince.mit-license.org/
  [gh-pages/example]: https://github.com/tlvince/identify.js/blob/gh-pages/example/index.html
  [blockquote]: http://tlvince.github.com/identify.js/example/#blockquote0]}
