notes/trac: trac-toc-my.diff
File trac-toc-my.diff, 1.4 KB (added by root, at 2015-05-14T11:00:05Z) |
---|
-
macro.py
old new 97 97 || `sectionindex` || Only display the page name and title of each page in the wiki section. || 98 98 || `titleindex` || Only display the page name and title of each page, similar to TitleIndex. || 99 99 || `notitle` || Supress display of page title. || 100 || `ordered` || ordered list. by default - unordered. || 100 101 || `reverse` || Display TOC sorted in reversed order. ''(Since 11.0.0.4)'' || 101 102 For `titleindex` argument, an empty pagelist will evaluate to all pages: 102 103 {{{ … … 133 134 inline = False 134 135 pagenames = [] 135 136 reverse = False 137 ordered = False 136 138 137 139 default_heading = 'Table of Contents' 138 140 params = {'min_depth': 1, 'max_depth': 6} … … 141 143 arg = arg.strip() 142 144 if arg == 'inline': 143 145 inline = True 146 elif arg == 'ordered': 147 ordered = True 144 148 elif arg == 'noheading': 145 149 default_heading = '' 146 150 elif arg == 'notitle': … … 196 200 pagenames = temp_pagenames 197 201 198 202 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() 200 206 base.append([heading and tag.h4(heading), ol]) 201 207 202 208 active = len(pagenames) > 1