This could be done with jQuery in an hour or two with properly defined content. You would need to identify a unique place in the document to generate the ToC as well as be able to identify the headers to be included. jQuery could even add Anchors in the content to allow for hyperlinks directly to the sections.
/// build new ToC Html with title / links
newToCHtml += "<li>" + jQuery(this).text() + "</li>"