Ticket #2 (closed defect: fixed)

Opened 4 years ago

Last modified 2 years ago

Does not handle changes in header depth gracefully

Reported by: athomas Assigned to: cboos
Priority: low Component: TocMacro
Severity: normal Keywords:
Cc: sns@severinghaus.org Trac Release: 0.11

Description

If headers jump more than one level at a time, eg. from == to ====, the TocMacro will display <li> entries for intervening header levels. This is not ideal.

Attachments

Change History

12/04/04 20:45:52 changed by Steven N. Severinghaus <sns@severinghaus.org>

  • cc set to sns@severinghaus.org.

I have a patch (or at least some svn diff output, if that's usable) for the TOC macro that makes it output valid HTML. It's not particularly clean code, but it seems to handle all the weird cases that I threw at it fairly well. You can find my test case (in my wiki's SandBox) here (valid!), and you can find the diff on my website here. The full source is here.

I should have done this in two stages, but this version also includes a relatively small modification (for which there is a diff without the above changes here) that does the traditional outline numbering and adds a depth-based CSS class to each <ol> . The example in our sandbox shows both of these.

You can remove the inline styles (the style="list-style-type: ...;" part) and just add some CSS statements like this, if you want:

ol.toc-depth1 { list-style-type: upper-roman; }
ol.toc-depth2 { list-style-type: upper-alpha; }
ol.toc-depth3 { list-style-type: decimal; }
...

This would be somewhat cleaner and less redundant, I suppose.

07/12/05 23:40:55 changed by athomas

  • version changed from 0.1 to stable.
  • milestone changed from 1.0 to 0.9.

01/09/06 08:35:23 changed by athomas

  • milestone deleted.

Milestone 0.9 deleted

01/25/07 04:37:46 changed by cboos

  • owner changed from athomas to cboos.
  • release set to 0.11.

This is still present in the 0.11 branch, mostly annoying with the inline mode.

01/26/07 03:23:38 changed by cboos

  • status changed from new to closed.
  • resolution set to fixed.

(In [1907]) The outline tree is now much nicer in inline mode, as there won't be a new entry for each sublevel. Rather, the previous entry will be reused if available. Plus other validation fixes (the TOC macro now always validates).

Fixes #2.


Add/Change #2 (Does not handle changes in header depth gracefully)




Change Properties
Action