An open API service indexing awesome lists of open source software.

https://github.com/assemble/grunt-assemble-anchors

Assemble plugin for creating anchor tags from generated html.
https://github.com/assemble/grunt-assemble-anchors

Last synced: about 2 months ago
JSON representation

Assemble plugin for creating anchor tags from generated html.

Awesome Lists containing this project

README

          

# grunt-assemble-anchors [![NPM version](https://badge.fury.io/js/grunt-assemble-anchors.svg)](http://badge.fury.io/js/grunt-assemble-anchors)

> Assemble plugin for creating anchor tags from headings in generated html using Cheerio.js.

## Example

## Before

```html

Glyphicons


```

## After

```html






Glyphicons


```

Currently the plugin adds [Bootstrap](http://getbootstrap.com/components/#glyphicons) glyphicon classes. If you want to use different classes, find a bug, or have a feature request, [please create an issue](https://github.com/assemble/grunt-assemble-anchors/issues/new)

[![image](https://f.cloud.github.com/assets/383994/1511486/c2414c4e-4aaf-11e3-9c16-30f2993ae2d7.png)](http://getbootstrap.com/components/#glyphicons)

Visit the [anchors example repo](https://github.com/assemble/example-assemble-anchors).

## Quickstart

In the command line, run:

```bash
npm install grunt-assemble-anchors --save
```

Next, register the plugin with Assemble:

```js
assemble: {
options = {
plugins: ['grunt-assemble-anchors', 'other/plugins/*']
}
};
```

## Options

### template

Specify a custom template (Underscore/Lo-Dash) to use for anchor markup. This is the default template:

```js
module.exports = [
'',
' ',
' ',
'
'
].join('\n');
```

To use a custom template just specify it in the options as follows:

```js
options: {
plugins: ['grunt-assemble-anchors'],
anchors: {
template: './path/to/custom/template.js'
}
}
```

Visit the [plugins docs](http://assemble.io/plugins/) for more info or for help getting started.

## Other grunt-assemble plugins

## Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/assemble/grunt-assemble-anchors/issues/new).

## Author

**Brian Woodward**

+ [github/doowb](https://github.com/doowb)
+ [twitter/doowb](http://twitter.com/doowb)

## License

Copyright © 2015 Brian Woodward
Released under the MIT license.

***

_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on September 24, 2015._