Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hanchor

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hanchor

Autogenerate links to header tags from header text

  • 1.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

hanchor

Build Status David David

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 <head> of your HTML document.

<head>
  <script src="https://unpkg.com/hanchor@1.0.7" />
</head>
<html>
  ...
  <script type="text/javascript">
    (function() {
      hanchor.init('article');
    })();
  </script>
  ...
</html>

API

hanchor(scope, [options])

scope

Type: stringor 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 © Rodney Dennis

Keywords

FAQs

Package last updated on 26 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc