mercurial/minirst.py
changeset 15015 ee6988aea74e
parent 15014 a814e986859f
child 15036 bb96e12a3242
--- a/mercurial/minirst.py	Tue Aug 02 17:43:18 2011 -0500
+++ b/mercurial/minirst.py	Tue Aug 02 17:43:20 2011 -0500
@@ -485,6 +485,15 @@
             secs[-1][2].append(b)
     return secs
 
+def decorateblocks(blocks, width):
+    '''generate a list of (section name, line text) pairs for search'''
+    lines = []
+    for s in getsections(blocks):
+        section = s[0]
+        text = formatblocks(s[2], width)
+        lines.append([(section, l) for l in text.splitlines(True)])
+    return lines
+
 if __name__ == "__main__":
     from pprint import pprint