mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add StandardDomain.add_program_option()
This commit is contained in:
@@ -196,10 +196,12 @@ class Cmdoption(ObjectDescription):
|
||||
targetname = 'cmdoption' + targetname
|
||||
signode['names'].append(targetname)
|
||||
|
||||
domain = cast(StandardDomain, self.env.get_domain('std'))
|
||||
self.state.document.note_explicit_target(signode)
|
||||
for optname in signode.get('allnames', []):
|
||||
self.env.domaindata['std']['progoptions'][currprogram, optname] = \
|
||||
self.env.docname, signode['ids'][0]
|
||||
domain.add_program_option(currprogram, optname,
|
||||
self.env.docname, signode['ids'][0])
|
||||
|
||||
# create only one index entry for the whole option
|
||||
if optname == firstname:
|
||||
self.indexnode['entries'].append(
|
||||
@@ -652,6 +654,10 @@ class StandardDomain(Domain):
|
||||
# type: (unicode, unicode, unicode, unicode) -> None
|
||||
self.data['objects'][objtype, name] = (docname, labelid)
|
||||
|
||||
def add_program_option(self, program, name, docname, labelid):
|
||||
# type: (unicode, unicode, unicode, unicode) -> None
|
||||
self.data['progoptions'][program, name] = (docname, labelid)
|
||||
|
||||
def check_consistency(self):
|
||||
# type: () -> None
|
||||
for name, (docname, labelid, lineno) in self.data['citations'].items():
|
||||
|
||||
Reference in New Issue
Block a user