This is a small patch against formatter/text_html.py that allows the #pragma section-number to be set to a negative value, giving it the opposite meaning to the positive numbers. For example, #pragma section-number -3 will show numbers on heading levels 1 through 3.
--- text_html.py.orig 2008-05-06 16:46:23.000000000 +1000
+++ text_html.py 2008-05-06 16:49:23.000000000 +1000
@@ -598,7 +598,7 @@
self._show_section_numbers = 0
elif numbering in ['1', 'on']:
self._show_section_numbers = 1
- elif numbering in ['2', '3', '4', '5', '6']:
+ elif numbering in ['2', '3', '4', '5', '6', '-1', '-2', '-3', '-4', '-5']:
# explicit base level for section number display
self._show_section_numbers = int(numbering)
@@ -616,7 +616,10 @@
while len(self.request._fmt_hd_counters) < count_depth:
self.request._fmt_hd_counters.append(0)
self.request._fmt_hd_counters[-1] = self.request._fmt_hd_counters[-1] + 1
- number = '.'.join(map(str, self.request._fmt_hd_counters[self._show_section_numbers-1:]))
+ if self._show_section_numbers < 0 and count_depth <= abs(self._show_section_numbers):
+ number = '.'.join(map(str, self.request._fmt_hd_counters[:abs(self._show_section_numbers)]))
+ if self._show_section_numbers > 0:
+ number = '.'.join(map(str, self.request._fmt_hd_counters[self._show_section_numbers-1:]))
if number: number += ". "
attr = {}