Mercurial > hg
comparison mercurial/minirst.py @ 39340:b2feccc199c2
minirst: mark getsections() as an internal helper
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 05 Aug 2018 13:34:58 +0900 |
parents | 57f9b3d91abc |
children | ca2f4dabf51d |
comparison
equal
deleted
inserted
replaced
39339:d30867a745a1 | 39340:b2feccc199c2 |
---|---|
678 return formatplain(blocks, width=width) | 678 return formatplain(blocks, width=width) |
679 | 679 |
680 def filtersections(blocks, section): | 680 def filtersections(blocks, section): |
681 """Select parsed blocks under the specified section""" | 681 """Select parsed blocks under the specified section""" |
682 parents = [] | 682 parents = [] |
683 sections = getsections(blocks) | 683 sections = _getsections(blocks) |
684 blocks = [] | 684 blocks = [] |
685 i = 0 | 685 i = 0 |
686 lastparents = [] | 686 lastparents = [] |
687 synthetic = [] | 687 synthetic = [] |
688 collapse = True | 688 collapse = True |
726 '.'.join(path + [realline[0]]).replace('"', '')) | 726 '.'.join(path + [realline[0]]).replace('"', '')) |
727 del blocks[s[0]:real] | 727 del blocks[s[0]:real] |
728 | 728 |
729 return blocks | 729 return blocks |
730 | 730 |
731 def getsections(blocks): | 731 def _getsections(blocks): |
732 '''return a list of (section name, nesting level, blocks) tuples''' | 732 '''return a list of (section name, nesting level, blocks) tuples''' |
733 nest = "" | 733 nest = "" |
734 level = 0 | 734 level = 0 |
735 secs = [] | 735 secs = [] |
736 | 736 |