https://github.com/gromnitsky/toc-jumper
Look up a string in the TOC of some HTML manual and go to that entry. Loosely based on `(Info-index)` idea from the Emacs `Info-mode`.
https://github.com/gromnitsky/toc-jumper
Last synced: 7 months ago
JSON representation
Look up a string in the TOC of some HTML manual and go to that entry. Loosely based on `(Info-index)` idea from the Emacs `Info-mode`.
- Host: GitHub
- URL: https://github.com/gromnitsky/toc-jumper
- Owner: gromnitsky
- Created: 2016-09-01T15:33:39.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-09-14T16:48:53.000Z (about 9 years ago)
- Last Synced: 2025-01-20T06:42:13.874Z (9 months ago)
- Language: HTML
- Size: 356 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# toc-jumper
Look up a string in the TOC of some HTML manual and go to that entry.
Loosely based on `(Info-index)` idea from the Emacs `Info-mode`.The example for the huge [Mutt](http://www.mutt.org/) manual:

To see it in action, clone the repo, open `test/manual.html` in a
browser & press i.## Quick start
~~~
document.addEventListener('DOMContentLoaded', () => {
let tj = new TocJumper({ selector: 'h1,h2,h3,h4' })
tj.hook()
})~~~
No external dependencies needed.
You can also set a custom initial position of the widget:
new TocJumper({ selector: '...',
top: '1em', right: 'auto', left: '5%' })By default it's `top: '4em', right: '.5em'`.
The widget window is mouse-movable. If user changes its initial
position, the widget coordinates are saved in the localStorage. To
disable auto-saving, pass `pref_save: false`.## Compilation
Firstly, you'll need browserify, babelify & babel-preset-es2015
installed _globally_. Then$ npm i
$ make releasecreates both development & production builds in `dist/`.
It uses a modified version of
[autoComplete](https://goodies.pixabay.com/javascript/auto-complete/demo.html),
so don't try to replace it w/ some npm dependency.## License
MIT.