[pmwiki-users] Re: (:toc) on another page

John Rankin john.rankin at affinity.co.nz
Tue Mar 29 20:16:32 CST 2005


On Wednesday, 30 March 2005 1:44 PM, Patrick R. Michaud <pmichaud at pobox.com> wrote:
>On Wed, Mar 30, 2005 at 01:27:38PM +1200, John Rankin wrote:
>> Yes, I dithered over which way to go. I eventually plumped for
>> (:toc-page PageName:) over (:toc page=PageName:) for these reasons:
>> - other directives, such as include and redirect are of the form
>>   (:directive PageName:) so I followed this convention, although
>>   I suspect there are exceptions
>>[...]
>
>FWIW, I dithered over the same issue(s) for the latest (:attachlist:)
>markup, and I ultimately came to the conclusion that followng the
>include/redirect convention would indicate
>
>   (:toc PageName:)

Unfortunately, (:toc PageName:) will (currently) produce a
toc for the /current/ page, using PageName as the text for the
toc's title line.

I suppose I could get clever and say 'if the thing you think is
a title is the name of a page that exists and it has a (:toc:)
directive on it, treate PageName as a page name otherwise treat 
it as the title text of a toc for the current page'. Hmmm. 
It seemed to me at the time that separate directives was
clearer, rather than trying to guess what the author meant.
>
>over either (:toc page=PageName:) or (:toc-page PageName:).  Using
>ParseArgs(), one can now handle spaces with something like
>
>   (:directive "Page Name":)

I'm afraid I just treat whatever comes between toc-page and :) as 
if it's a reference to a page and wrap [[ ... ]] around it.
The makepagename function will strip away any invalid characters.


-- 
JR
--
John Rankin






More information about the pmwiki-users mailing list