Attachment 'toc.patch'

Download

   1 diff -r 83451b52e947 MoinMoin/macro/TableOfContents.py
   2 --- a/MoinMoin/macro/TableOfContents.py	Sat Mar 28 13:13:23 2009 +0100
   3 +++ b/MoinMoin/macro/TableOfContents.py	Mon Mar 30 22:47:29 2009 +0200
   4 @@ -137,6 +137,11 @@
   5  
   6   maxdepth:: maximum depth the table of contents is generated for (defaults to unlimited)
   7      """
   8 +    try:
   9 +        mindepth = int(macro.request.getPragma('section-numbers', 1))
  10 +    except (ValueError, TypeError):
  11 +        mindepth = 1
  12 +
  13      if maxdepth is None:
  14          maxdepth = 99
  15  
  16 @@ -176,7 +181,7 @@
  17          if txt is None:
  18              incl_id = id
  19              continue
  20 -        if lvl > maxdepth or id is None:
  21 +        if lvl < mindepth or lvl > maxdepth or id is None:
  22              continue
  23          if lvl < lastlvl:
  24              lastlvl = lvl
  25 @@ -188,7 +193,7 @@
  26          if txt is None:
  27              incl_id = id
  28              continue
  29 -        if lvl > maxdepth or id is None:
  30 +        if lvl < mindepth or lvl > maxdepth or id is None:
  31              continue
  32  
  33          # will be reset by pop_unique_ids below

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2009-03-30 20:49:38, 1.0 KB) [[attachment:toc.patch]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.