[pmwiki-users] Table of content generation
Pierre Rouzeau
pierre at rouzeau.net
Wed Feb 16 16:27:14 CST 2005
Hello,
after having fighted for some time to have the NumberedHeaders recipe
working with the John rankin Table of contents recipe, i have gone ahead
and decided to build myself my table of content.
Building a table of content from markup is relatively easy.
Displaying it is another story.
I am building the content of the table during interpretation of the
title markups. Then, the interpretation is finished, and i want the
table to be set 'before' the contents it is supposed to link to. I can
make a reference to the variable containing the table easily, but how
can i have it converted in its content *after* the interpretation of the
title markup ? I failed to do that directly. I've tried many solutions,
including the use of superglobals like $_GLOBALS('Ntoctable'), with no
avail.
I have a working solution by making a first interpretation of the markup
with MarkupToHTML function which fill my table, and then the same
function is executed again by the page. That does work, but is a bit
outrageous because it means the whole markup is interpreted two times.
Is there any better solution ? I can, in last resort, try to modify the
global markup table to have the first pass only interpreting the title
markup. This will be better, but if there is a solution to simply
'delay' the transformation of my variable in its content, it will be
simpler.
Please note that i have not been able to understand how does work the
recipe page table of content of John Rankin, so cannot use the same
method...
Regards
Page principale - Main page - www.rouzeau.net <http://www.rouzeau.net>
---------------------------------------------------------------------------
More information about the pmwiki-users
mailing list