diff options
| author | Georg Brandl <georg@python.org> | 2008-12-28 23:59:40 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2008-12-28 23:59:40 +0100 |
| commit | 9c80f3ece26e7fc5cbb3e3abec4ae3c697bb6604 (patch) | |
| tree | ed4592d20b540bb36a6c18e6465e6d3b2ed47749 /sphinx | |
| parent | e92a0af4bcc2977913314e4552ef6183a6eb9c11 (diff) | |
| download | sphinx-9c80f3ece26e7fc5cbb3e3abec4ae3c697bb6604.tar.gz | |
Fix #46: allow linking to special labels via :ref:`abc <genindex>`.
Diffstat (limited to 'sphinx')
| -rw-r--r-- | sphinx/environment.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sphinx/environment.py b/sphinx/environment.py index 87cf9c04..66ace0b8 100644 --- a/sphinx/environment.py +++ b/sphinx/environment.py @@ -15,6 +15,7 @@ import time import heapq import types import imghdr +import string import difflib import cPickle as pickle from os import path @@ -290,9 +291,12 @@ class BuildEnvironment: 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 |
