Commits

Anonymous committed 62cc2cf

nicer index (two column layout)

Comments (0)

Files changed (1)

sphinx/builders/pdf.py

         # Add index at the end of the document
 
         genindex = self.env.create_index(self)
-        index_nodes=genindex_nodes(genindex)
+        pb,index_nodes=genindex_nodes(genindex)
+        tree.append(pb)
         tree.append(index_nodes)
 
         return tree
                 pass
 
 def genindex_nodes(genindexentries):
-    output=['DUMMY','=====','','','INDEX','=====','']
+    output=['DUMMY','=====','','.. raw:: pdf\n\n    PageBreak twoColumn\n\n','INDEX','=====','']
 
     for key, entries in genindexentries:
-        output.append('.. cssclass:: heading3\n\n%s\n\n'%key) # initial
+        output.append('.. cssclass:: heading4\n\n%s\n\n'%key) # initial
         for entryname, (links, subitems) in entries:
             if links:
                 output.append('`%s <%s>`_'%(entryname,links[0]))
                     output.append('')
 
     doctree = docutils.core.publish_doctree('\n'.join(output))
-    return doctree[1]
+    return doctree[0][1],doctree[1]