[pmwiki-users] Handy Table of Contents recipe

Dominique Faure dominique.faure at gmail.com
Sun Feb 11 04:37:08 CST 2007


On 2/11/07, Kathryn Andersen <kat_lists at katspace.homelinux.org> wrote:
> On Sat, Feb 10, 2007 at 07:22:18PM -0000, marc wrote:
> > Patrick R. Michaud said...
> > > On Fri, Feb 09, 2007 at 05:56:59PM -0000, marc wrote:
> > > >
> > > > I've also moved $HTMLHeaderFmt['handytoc'] into the function (and thus
> > > > removed Markup("handytoc1"), because I like to keep <head> as small as
> > > > possible.
> > >
> > > I haven't looked at the recipe details, but does this change
> > > allow (:toc:) to still work even when it appears in a sidebar
> > > and not the main contents?
> >
> > (:htoc:), yes. Although, I use $HTMLFooterFmt, since, as you say...
> >
> > > (Markup functions called from sidebars are unable to manipulate the
> > > contents of the <head> section of output, because by that point
> > > the <head> has already been output.)
> >
> > $HTMLHeaderFmt won't work.
>
> I'm sorry, I can't follow this.  I can't make the recipe work using
> $HTMLFooterFmt, and as PM says, it won't work for sidebars unless
> $HTMLHeaderFmt is already defined.  So unless you can give me an example
> of how to make this work, I'm going to keep $HTMLHeaderFmt as it is,
> defined whether (:htoc:) is on the page or not.
>
> I'm working on the other stuff, though.
>

May I suggest to use the same kind of trick I used in the (hidden)
LinkedResourceExtras recipe, ie. using your own caching mecanism to
choose whether or not to output your shared javascript functions.

An other way to do that could be to generate your own $PageTextStartFmt...

Dom

[1] http://www.pmichaud.com/wiki/Cookbook/LinkedResourceExtras



More information about the pmwiki-users mailing list