https://github.com/rod/hanchor
⚓️ Autogenerate links to header tags from header text
https://github.com/rod/hanchor
anchor generator heading links
Last synced: 3 months ago
JSON representation
⚓️ Autogenerate links to header tags from header text
- Host: GitHub
- URL: https://github.com/rod/hanchor
- Owner: rod
- License: mit
- Created: 2017-02-17T17:27:19.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-26T12:48:10.000Z (about 9 years ago)
- Last Synced: 2025-09-24T07:52:10.069Z (8 months ago)
- Topics: anchor, generator, heading, links
- Language: JavaScript
- Homepage:
- Size: 99.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# hanchor
[](https://travis-ci.org/rod/hanchor) []() []()
> Autogenerate links to header tags from header text
## Installation
```
$ npm install --save hanchor
```
## Usage
The quickest way to begin using hanchor is to include it in the `` of your HTML document.
```html
```
```html
...
(function() {
hanchor.init('article');
})();
...
```
## API
### hanchor(scope, [options])
#### scope
Type: `string`or `object`, Default: `'body'`
The DOM element that header linking is scoped to.
#### options.content
Type: `string`, Default: `'#'`
The content of the header tag link.
#### options.className
Type: `string` or `false`, Default: `false`
Class to be assigned to the header tag links.
#### options.position
Type: `string`, Default: `'beforeend'`
Position the link `'beforebegin'`, `'afterbegin'`, `'beforeend'` or `'afterend'` in reference to the the header tag.
## License
[MIT](/license) © Rodney Dennis