Closed matryer closed 11 years ago
I'll add this in the next version as an option. Good idea!
Ohh in that case, how about this.
{
"hashGenerator": "pretty"
}
or even
{
"hashGenerator": function(text) {
// do my own hash generation here!
}
}
I think it would be nice to have the ability to either supply a string option or a custom function. Do you think people would only want underscore separated words? Or are there other formats as well? Also, feel free to send a PR if you are up for it. No pressure!
Thanks again for your PR!
Currently Tocify removes whitespace from headings in order to generate the hash values (i.e. the bookmark after the
#
in the URL), which is sensible. So "Tell me About It" becomes#TellmeAboutIt
.What if it replaced the spaces with hyphens
-
and made it all lowercase, so you would end up with#tell-me-about-it
.Pros:
Cons: