Add genindex and domain indices to spine.

This commit is contained in:
Georg Brandl
2011-01-15 14:40:16 +01:00
parent 10103108fb
commit 1edf477686

View File

@@ -229,8 +229,7 @@ class EpubBuilder(StandaloneHTMLBuilder):
}) })
def fix_fragment(self, prefix, fragment): def fix_fragment(self, prefix, fragment):
"""Return a href/id attribute with colons replaced by hyphens. """Return a href/id attribute with colons replaced by hyphens."""
"""
return prefix + fragment.replace(':', '-') return prefix + fragment.replace(':', '-')
def fix_ids(self, tree): def fix_ids(self, tree):
@@ -400,6 +399,14 @@ class EpubBuilder(StandaloneHTMLBuilder):
spine.append(_spine_template % { spine.append(_spine_template % {
'idref': self.esc(self.make_id(item['refuri'])) 'idref': self.esc(self.make_id(item['refuri']))
}) })
for info in self.domain_indices:
spine.append(_spine_template % {
'idref': self.esc(self.make_id(info[0] + self.out_suffix))
})
if self.config.html_use_index:
spine.append(_spine_template % {
'idref': self.esc(self.make_id('genindex' + self.out_suffix))
})
spine = '\n'.join(spine) spine = '\n'.join(spine)
# write the project file # write the project file