notes/trac: trac-toc-my.diff

File trac-toc-my.diff, 1.4 KB (added by root, at 2015-05-14T11:00:05Z)

возможность выбора между ul и ol в tractoc

  • macro.py

    old new  
    9797    || `sectionindex` || Only display the page name and title of each page in the wiki section. ||
    9898    || `titleindex`   || Only display the page name and title of each page, similar to TitleIndex. ||
    9999    || `notitle`      || Supress display of page title. ||
     100    || `ordered`      || ordered list. by default - unordered. ||
    100101    || `reverse`      || Display TOC sorted in reversed order.  ''(Since 11.0.0.4)'' ||
    101102    For `titleindex` argument, an empty pagelist will evaluate to all pages:
    102103    {{{
     
    133134        inline = False
    134135        pagenames = []
    135136        reverse = False
     137        ordered = False
    136138       
    137139        default_heading = 'Table of Contents'
    138140        params = {'min_depth': 1, 'max_depth': 6}
     
    141143            arg = arg.strip()
    142144            if arg == 'inline':
    143145                inline = True
     146            elif arg == 'ordered':
     147                ordered = True
    144148            elif arg == 'noheading':
    145149                default_heading = ''
    146150            elif arg == 'notitle':
     
    196200        pagenames = temp_pagenames
    197201
    198202        base = tag.div(class_=inline and 'wiki-toc-inline' or 'wiki-toc')
    199         ol = tag.ol()
     203        ol = tag.ul()
     204        if ordered:
     205         ol = tag.ol()
    200206        base.append([heading and tag.h4(heading), ol])
    201207
    202208        active = len(pagenames) > 1