summaryrefslogtreecommitdiff
path: root/sandbox/py-rest-doc/sphinx/builder.py
diff options
context:
space:
mode:
authorgbrandl <gbrandl@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2007-07-18 22:51:16 +0000
committergbrandl <gbrandl@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2007-07-18 22:51:16 +0000
commitad8b63ed425392b0054d16c5ece5d4d2379aa99c (patch)
treea45d4b763cc7cdc722892cdbf11f96bc363b8ef8 /sandbox/py-rest-doc/sphinx/builder.py
parentbb090dad1a55775d711d818d6bed08c265332a83 (diff)
downloaddocutils-ad8b63ed425392b0054d16c5ece5d4d2379aa99c.tar.gz
Add checkboxes for hiding modules based on platform.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@5380 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'sandbox/py-rest-doc/sphinx/builder.py')
-rw-r--r--sandbox/py-rest-doc/sphinx/builder.py10
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')),
)