jQuery-TOC
jQuery-TOC copied to clipboard
Elgandoz patch 1 (#1)
Add automatic prefix based on title.
let toc = initTOC({
selector: 'h2',
prefix: true
})
The above code will generate links like #this-is-the-header-title
.
It maintains all the previous behaviours and defaults.
The convertToUrl()
logic is taken from this answer.
It requires minification for the dist folder.