mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
#308: allow "double" as alias for "pair" in index entries.
This commit is contained in:
@@ -235,7 +235,7 @@ class Index(Directive):
|
|||||||
option_spec = {}
|
option_spec = {}
|
||||||
|
|
||||||
indextypes = [
|
indextypes = [
|
||||||
'single', 'pair', 'triple',
|
'single', 'pair', 'double', 'triple',
|
||||||
]
|
]
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
@@ -259,6 +259,8 @@ class Index(Directive):
|
|||||||
for type in self.indextypes:
|
for type in self.indextypes:
|
||||||
if entry.startswith(type+':'):
|
if entry.startswith(type+':'):
|
||||||
value = entry[len(type)+1:].strip()
|
value = entry[len(type)+1:].strip()
|
||||||
|
if type == 'double':
|
||||||
|
type = 'pair'
|
||||||
ne.append((type, value, targetid, value))
|
ne.append((type, value, targetid, value))
|
||||||
break
|
break
|
||||||
# shorthand notation for single entries
|
# shorthand notation for single entries
|
||||||
|
|||||||
@@ -162,6 +162,7 @@ Index markup
|
|||||||
.. index::
|
.. index::
|
||||||
single: entry
|
single: entry
|
||||||
pair: entry; pair
|
pair: entry; pair
|
||||||
|
double: entry; double
|
||||||
triple: index; entry; triple
|
triple: index; entry; triple
|
||||||
keyword: with
|
keyword: with
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user