mercurial/minirst.py
changeset 15015 ee6988aea74e
parent 15014 a814e986859f
child 15036 bb96e12a3242
equal deleted inserted replaced
15014:a814e986859f 15015:ee6988aea74e
   483                 # add an initial empty section
   483                 # add an initial empty section
   484                 secs = [('', 0, [])]
   484                 secs = [('', 0, [])]
   485             secs[-1][2].append(b)
   485             secs[-1][2].append(b)
   486     return secs
   486     return secs
   487 
   487 
       
   488 def decorateblocks(blocks, width):
       
   489     '''generate a list of (section name, line text) pairs for search'''
       
   490     lines = []
       
   491     for s in getsections(blocks):
       
   492         section = s[0]
       
   493         text = formatblocks(s[2], width)
       
   494         lines.append([(section, l) for l in text.splitlines(True)])
       
   495     return lines
       
   496 
   488 if __name__ == "__main__":
   497 if __name__ == "__main__":
   489     from pprint import pprint
   498     from pprint import pprint
   490 
   499 
   491     def debug(func, *args):
   500     def debug(func, *args):
   492         blocks = func(*args)
   501         blocks = func(*args)