From: Aredridel Date: 2005-03-18T01:23:32+09:00 Subject: Re: *cloth and ToC On Fri, 2005-03-18 at 00:44 +0900, Guillaume Marcais wrote: > Is there a way to extract a table of content of a text with redcloth of > bluecloth? > > What I have in mind is the ability to extract all the headers of a text > (h1., h2., etc. in textile) and generate: anchors within the html page > on these headers and a table of content with links to the headers. > > So at the end of a wiki page I could add something like: > >
> ToC. <-- Replaced by *cloth bye the table of content --> >
> > and get a beautiful and well linked table of content for free. > > Is there already such a feature? Is it a reasonable feature request? Sounds like it would be better implemented as an output filter -- a method that could take formatted HTML text as input, and add the table of contents to the top, or return an array of the table of contents and the HTML. I'd be willing to take a stab at that if you'd like. It would be useful to me, too, and useful to me to be independent of the markup engine.