diff options
Diffstat (limited to 'sandbox/py-rest-doc/sphinx/builder.py')
-rw-r--r-- | sandbox/py-rest-doc/sphinx/builder.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sandbox/py-rest-doc/sphinx/builder.py b/sandbox/py-rest-doc/sphinx/builder.py index 884718586..9b5cccd67 100644 --- a/sandbox/py-rest-doc/sphinx/builder.py +++ b/sandbox/py-rest-doc/sphinx/builder.py @@ -390,14 +390,18 @@ class StandaloneHTMLBuilder(Builder): '#module-' + mn, sy, pl)) for (mn, (fn, sy, pl)) in self.env.modules.iteritems()), key=lambda x: x[0].lower()) + # collect all platforms + platforms = set() # sort out collapsable modules modindexentries = [] pmn = '' cg = 0 # collapse group fl = '' # first letter for mn, (fn, sy, pl) in modules: + pl = pl.split(', ') if pl else [] + platforms.update(pl) if fl != mn[0].lower() and mn[0] != '_': - modindexentries.append(['', False, 0, False, mn[0].upper(), '', '']) + modindexentries.append(['', False, 0, False, mn[0].upper(), '', []]) tn = mn.partition('.')[0] if tn != mn: # submodule @@ -407,15 +411,17 @@ class StandaloneHTMLBuilder(Builder): elif not pmn.startswith(tn): # submodule without parent in list, add dummy entry cg += 1 - modindexentries.append([tn, True, cg, False, '', '', '']) + modindexentries.append([tn, True, cg, False, '', '', []]) else: cg += 1 modindexentries.append([mn, False, cg, (tn != mn), fn, sy, pl]) pmn = mn fl = mn[0].lower() + platforms = sorted(platforms) modindexcontext = dict( modindexentries = modindexentries, + platforms = platforms, current_page_name = 'modindex', pathto = relpath_to(self, self.get_target_uri('modindex.rst')), ) |