Here is a patch to create an index by sub-sections
Code:
87,96c87,89
<
< for ul in idx.findAll('ul', recursive=False):
< for li in ul.findAll('li', recursive=False):
< s = li.find('strong',attrs={'class':'book'})
< if s is not None:
< a1 = s.find('a', href=True)
< section_title = self.tag_to_string(a1)
< for a in li.findAll('a', attrs={'class':'book-section'}, href=True):
< sub_section_title = section_title.strip() + " : " + self.tag_to_string(a).strip()
< yield (sub_section_title, a['href'])
---
> for s in idx.findAll('strong', attrs={'class':'book'}):
> a = s.find('a', href=True)
> yield (self.tag_to_string(a), a['href'])