[pmwiki-users] Re: Table of Contents (Was: picks up Q:-markup)

chr at home.se chr at home.se
Fri Jan 28 02:51:46 CST 2005


On 28 Jan 2005, John Rankin wrote:

> On Thursday, 27 January 2005 3:54 AM, chr at home.se wrote:
> ...
> >> So my question back is: Do you want to deactivate this
> >> 
> >> - for all questions
> >> 
> >> - for some questions
> >> 
> >> - on all pages
> >> 
> >> - on some pages
> >
> >In this particular case I had lots of sections and I didn't want any 
> >questions to make it into the list. OTOH, wiki.lyx.org would probably want 
> >questions to be included in the TOC for at least the FAQ-group.
> >
> >So the answer would be that I'd want questions (Q:) to be included on some 
> >pages, but not on all. 
> 
> Ah!
> Download and install the latest version of pagetoc.php from
> http://www.pmwiki.org/wiki/Cookbook/PageTableOfContents
> 
> Set up 2 test pages, both with some Q: markup.
> 
> On one page, put (:toc:) as usual.
> This should include Q: markups.

I think (:toc:) should *not* include Q: by default (but that's possible to 
change as you describe below). However, what about definitions (:: :)? Are 
these included?

> On the other put (:toc Q:) (no spaces between the Q and :)
> This should exclude Q: markups.
> 
> Now edit config.php and add the following line:
>     $OmitQMarkup = true;
> 
> The page with (:toc:) should now omit Q: markups.
> 
> The page with (:toc Q:) should now include Q: markups.
> 
> I think this meets the requirement. Please check the 
> generated anchor numbering carefully -- it's possible
> that this change has broken the code somewhere.
> 
> Other features, such as Q* overrides the $OmitQMarkup value,
> could be added if there is a need. But at the moment such 
> capabilities appear to be superfluous.
> 
> Questions? Comments?

I wonder if we're not making this too complicated. Basically I think I 
only do this:

* Generate a TOC where I don't want any questions etc included
* Generate a TOC where I do want questions etc (on a FAQ page typically)

Does anyone do other combinations in practice?

If not, then I'd suggest something like

	(:toc Table of Contents without questions:)

or

	(:toc include=all Table of Contents with questions etc:)

and if we want special cases of what should be included, we could fiddle 
with the argument to the 'include'-option. What do you think of this?

/Christian

-- 
Christian Ridderström, +46-8-768 39 44               http://www.md.kth.se/~chr





More information about the pmwiki-users mailing list