[pmwiki-users] Handy Table of Contents recipe

Kathryn Andersen kat_lists at katspace.homelinux.org
Wed Feb 7 15:07:35 CST 2007

On Wed, Feb 07, 2007 at 08:42:38PM +0000, Hans wrote:
> Wednesday, February 7, 2007, 3:48:21 AM, Kathryn wrote:
> > So, HandyToc was born.
> Thank you!
> I tried it out and had some surprises (for me):
> I found it is not forgiving if I have a messy hierarchy of headers.
> for instance I had a page starting with h3, going to h5s,
> and later to more h3s and later to h2s.
> The toc ignored the later h2s, because the start was h3.
> and it misplaced indents for the later h3s (too far left), because
> there were no h4 (h3 to h5).
> So the recipe forced me to be really consistent with headers, and
> stick to a proper single step hierarchy.
> I say this because first I was surprised and thought it did not work,
> since it left headers out.

Yeah, it *is* unforgiving of a messy hierarchy.  It's a lot more work
to try to account for "missing" levels of hierarchy, I didn't want
to try to tackle that.  But you're right, I should at least put a note
on the recipe about that.
> One other thing though I wish would not happen:
> the toc includes headers from the rightbar, which is in a total
> different div than the page content.
> I wonder if this could be changed, and the toc only constructed from
> page content.

Ah.  I didn't run into that probably because I wasn't using headers
in my sidebar.
> Here is a test link showing what I mean:
> http://softflow.co.uk/design/Test/TriadSkin

I see.  I'll have to look into seeing if I can limit the "look for
headers" to the #wikitext div (which is the same no matter what the skin
is, yes?)
> And regards to showing/hiding the toc, I wonder if ShowHide cannot be
> used for this, acting on dic toc.

It looks as if you've done so on your page.

Kathryn Andersen
 _--_|\     | Kathryn Andersen	<http://www.katspace.com>
/      \    | 
\_.--.*/    | GenFicCrit mailing list <http://www.katspace.com/gen_fic_crit/>
      v     | 
------------| Melbourne -> Victoria -> Australia -> Southern Hemisphere
Maranatha!  |	-> Earth -> Sol -> Milky Way Galaxy -> Universe

More information about the pmwiki-users mailing list