I am starting to learn how to write plugins for Wordpress. I'm interested in using WP as a CMS for long essays (6000-9000 words or more). My problem is what I call the Kindle problem, which is how do you reliably address the different parts of an unpaginated document which can be read on a variety of screens/devices, and will reflow differently in each case. If I'm citing an ebook on my e-reader or in a browser, it's hard to refer to a specific passage and know that my reader will be able to follow it to the exact text location because there's no absolute "page number."
One possible solution is putting HTML anchors in the text. Is there any way to get Wordpress to do this automatically? Even better, is it possible for Wordpress to treat elements as if they were the beginning of an SGML element, and then automatically generate hierarchically numbered anchors for each heading, each sub-heading, and each paragraph or block 'enclosed' with them. I'm thinking of some way of doing what LaTeX does to \section{} tags.
Has this been done? Where exactly would this filter apply? Adam Brown says that there are over 1500 hooks you can use! That's pretty amazing, but also daunting too.
Thanks for your help.
Cheers,
Ryan