I created Anchorific.js in order to learn three things: Grunt, Qunit, and how to develop a jQuery plugin. So, I developed a jQuery plugin in order to this. I am a big believer in learning by doing. Learning passively through a book just never works for me and I just need to go out there and do it. This is the real reason why Anchorific.js was born; it is not because I was too lazy to create anchored headings and anchor navigations on a single-page document.
In a nutshell, Anchorific.js creates anchored headings and generates nested anchor navigations automatically based on the header tags. My intention is for it to be used in a single-page project documentation, like the one that I created for the demo page of the plugin. There are other plugins that are able to create anchored headings automatically. But there is no harm done for using an over-used idea in order learn what I wanted to learn. Plus, I have never really stumbled upon a plugin that generates anchor-based nested navigations automatically based on the header tags. So, I think I managed to add my own twist for this one.
I am planning to write about Grunt.js and unit testing with Qunit. I encountered several problems when I was unit testing the Scrollspy functionality of the plugin. I had no idea how to test for scrolling events. I searched around for guides but most of them focused on testing for click events. I had to come up with another way on how to do it and I would love to write about it as people may be facing the same problem.
Anyway, check out the project page and Anchorific is also on Github! I will be writing about Grunt.js and Qunit.js soon.