jimmynotjim / scrollnav

A dependency free JavaScript plugin for auto generating single page navigation
http://scrollnav.com
MIT License
461 stars 127 forks source link

Added support for sub-sections #13

Closed jimmynotjim closed 11 years ago

jimmynotjim commented 11 years ago

This PR adds support for parsing sub-sections within each section. Just as with sections, sub-sections are defined with a heading tag in the settings options (subSections) and are set to false by default. The plugin also formats the content of the article to wrap each section in a <section> and each sub-section in a <div> for easier filtering and control of the article contents (and to set up an upcoming fix for "active" states).

NOTES: Naming conventions were updated to standardize options, ids and classes (classes now follow BEM naming). This PR will most likely break existing initializations and stylesheets.

jimmynotjim commented 11 years ago

@wizcover Mind taking a look at this? Once I'm sure this is good I'll publish the active state fixes.

thomasguillory commented 11 years ago

@jimmynotjim OK I will take some time to review and test it tomorrow morning.

jimmynotjim commented 11 years ago

Tested all options and it's good. Eventually I'll set up some automated tests for this.