I've already prepared my own version of the Emacs manual that is
enhanced in this way, but I did it by hand because I expected it to
involve less typing than it actually did. Now I need to do Elisp, & I
also want the ability to redo the conversion when new versions of the
manuals become available, so I want to automate the process.
However, it seems to me to be such an obvious thing to do that I would
be surprised if it hasn't already been done. Please follow-up here if
you have code that does this. As an example, an input file of
<H1>GNU Emacs Manual</H1>
<P>
<UL>
<LI><A NAME="SEC1" HREF="emacs_0.html#SEC1">Topic 1</A>
<UL>
<LI><A NAME="SEC2" HREF="emacs_1.html#SEC2">Subtopic 1A</A>
<LI><A NAME="SEC3" HREF="emacs_2.html#SEC3">Subtopic 1B</A>
</UL>
<LI><A NAME="SEC4" HREF="emacs_2.html#SEC4">Topic 2</A>
</UL>
would produce an output file of
<H1>GNU Emacs Manual--Brief ToC</H1>
<P>
<UL>
<LI><A HREF="#SEC1">Topic 1</A>
<LI><A HREF="#SEC4">Topic 2</A>
</UL>
<H1>GNU Emacs Manual--Full ToC</H1>
<P>
<UL>
<LI><A NAME="SEC1" HREF="emacs_0.html#SEC1">Topic 1</A>
<UL>
<LI><A NAME="SEC2" HREF="emacs_1.html#SEC2">Subtopic 1A</A>
<LI><A NAME="SEC3" HREF="emacs_2.html#SEC3">Subtopic 1B</A>
</UL>
<LI><A NAME="SEC4" HREF="emacs_2.html#SEC4">Topic 2</A>
</UL>
allowing the brief ToC to be used to jump directly into the desired
topic in the full ToC.