Commits

Georg Brandl  committed 3c36362

Fix #46: allow linking to special labels via :ref:`abc <genindex>`.

  • Participants
  • Parent commits 4b72d06

Comments (0)

Files changed (1)

File sphinx/environment.py

 import heapq
 import types
 import imghdr
+import string
 import difflib
 import cPickle as pickle
 from os import path
         self.gloss_entries = set()  # existing definition labels
 
         # Some magically present labels
-        self.labels['genindex'] = ('genindex', '', _('Index'))
-        self.labels['modindex'] = ('modindex', '', _('Module Index'))
-        self.labels['search']   = ('search', '', _('Search Page'))
+        def add_magic_label(name, description):
+            self.labels[name] = (name, '', description)
+            self.anonlabels[name] = (name, '')
+        add_magic_label('genindex', _('Index'))
+        add_magic_label('modindex', _('Module Index'))
+        add_magic_label('search', _('Search Page'))
 
     def set_warnfunc(self, func):
         self._warnfunc = func