mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #46: allow linking to special labels via :ref:abc <genindex>
.
This commit is contained in:
parent
dc960ca7df
commit
1aa8baa0d8
@ -15,6 +15,7 @@ import time
|
|||||||
import heapq
|
import heapq
|
||||||
import types
|
import types
|
||||||
import imghdr
|
import imghdr
|
||||||
|
import string
|
||||||
import difflib
|
import difflib
|
||||||
import cPickle as pickle
|
import cPickle as pickle
|
||||||
from os import path
|
from os import path
|
||||||
@ -290,9 +291,12 @@ class BuildEnvironment:
|
|||||||
self.gloss_entries = set() # existing definition labels
|
self.gloss_entries = set() # existing definition labels
|
||||||
|
|
||||||
# Some magically present labels
|
# Some magically present labels
|
||||||
self.labels['genindex'] = ('genindex', '', _('Index'))
|
def add_magic_label(name, description):
|
||||||
self.labels['modindex'] = ('modindex', '', _('Module Index'))
|
self.labels[name] = (name, '', description)
|
||||||
self.labels['search'] = ('search', '', _('Search Page'))
|
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):
|
def set_warnfunc(self, func):
|
||||||
self._warnfunc = func
|
self._warnfunc = func
|
||||||
|
Loading…
Reference in New Issue
Block a user