equal
deleted
inserted
replaced
796 blevel += 1 |
796 blevel += 1 |
797 secs.append(('', blevel, [])) |
797 secs.append(('', blevel, [])) |
798 secs[-1][2].append(b) |
798 secs[-1][2].append(b) |
799 return secs |
799 return secs |
800 |
800 |
801 def decorateblocks(blocks, width): |
|
802 '''generate a list of (section name, line text) pairs for search''' |
|
803 lines = [] |
|
804 for s in getsections(blocks): |
|
805 section = s[0] |
|
806 text = formatblocks(s[2], width) |
|
807 lines.append([(section, l) for l in text.splitlines(True)]) |
|
808 return lines |
|
809 |
|
810 def maketable(data, indent=0, header=False): |
801 def maketable(data, indent=0, header=False): |
811 '''Generate an RST table for the given table data as a list of lines''' |
802 '''Generate an RST table for the given table data as a list of lines''' |
812 |
803 |
813 widths = [max(encoding.colwidth(e) for e in c) for c in zip(*data)] |
804 widths = [max(encoding.colwidth(e) for e in c) for c in zip(*data)] |
814 indent = ' ' * indent |
805 indent = ' ' * indent |