If you interpret markdown within your web-application and you’re using jQuery and coffeescript, you may use this Coffeescript to automatically generate a clickable index for the (markdown) page.

All you have to do is to insert a div with id #page-index somewhere on your layout.