Commits

Anonymous committed 735403b

Resolve pending_xrefs

  • Participants
  • Parent commits 4208a98

Comments (0)

Files changed (1)

File sphinx/builders/pdf.py

 from os import path
 
 from docutils import writers
+from docutils import nodes
 from docutils.io import FileOutput
 import docutils.core
 
 
         tree = self.env.get_doctree(indexfile)
         tree = process_tree(indexfile, tree)
-      
+
         # Add index at the end of the document
 
         genindex = self.env.create_index(self)
         tree.append(pb)
         tree.append(index_nodes)
 
+
+        for pendingnode in tree.traverse(addnodes.pending_xref):
+            pendingnode.replace_self(nodes.reference(text=pendingnode.astext(),
+                refuri=pendingnode['reftarget']))
         return tree
     
 
                 pass
 
 def genindex_nodes(genindexentries):
-    output=['DUMMY','=====','','.. raw:: pdf\n\n    PageBreak twoColumn\n\n','INDEX','=====','']
+    output=['DUMMY','=====','','.. raw:: pdf\n\n    PageBreak twoColumn\n\n.. _genindex:\n\n','INDEX','=====','']
 
     for key, entries in genindexentries:
         output.append('.. cssclass:: heading4\n\n%s\n\n'%key) # initial