Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/levimcg/hankerz
A simple vanilla JavaScript plugin for adding anchor links to headings on your static website.
https://github.com/levimcg/hankerz
Last synced: about 8 hours ago
JSON representation
A simple vanilla JavaScript plugin for adding anchor links to headings on your static website.
- Host: GitHub
- URL: https://github.com/levimcg/hankerz
- Owner: levimcg
- License: mit
- Created: 2019-03-08T03:55:25.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T17:28:22.000Z (almost 2 years ago)
- Last Synced: 2024-04-09T15:11:04.139Z (7 months ago)
- Language: JavaScript
- Homepage: https://levimcg.github.io/hankerz/
- Size: 157 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hankerz
A simple vanilla JavaScript plugin for adding anchor links to headings on your static website.## Getting started
```javascript
const headings = new Hankerz({
container: '.content-container',
className: 'custom-heading-class',
headingSelectors: '.content-container > h2, .content-container > h3',
linkIcon: someIcon // A string, or a function that returns a string
})
```## To-do
- [ ] Write some actual documentation
- [ ] Should the plugin just wrap heading `innerText` with a link instead of creating a separate link with an icon, etc. This would make every heading inside of the `container` option a link. Are there any A11Y considerations there?
- [ ] Explore how the `linkIcon` option should work. Should it be a function that returns a string? Should the plugin sanitize whatever input the user provides?
- [ ] Add a a build/dist process for publishing, etc.