diff options
Diffstat (limited to 'sphinx/domains/javascript.py')
-rw-r--r-- | sphinx/domains/javascript.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sphinx/domains/javascript.py b/sphinx/domains/javascript.py index d510d7903..6c75f8dd7 100644 --- a/sphinx/domains/javascript.py +++ b/sphinx/domains/javascript.py @@ -49,6 +49,11 @@ class JSObject(ObjectDescription): #: based on directive nesting allow_nesting = False + option_spec = { + 'noindex': directives.flag, + 'noindexentry': directives.flag, + } + def handle_signature(self, sig: str, signode: desc_signature) -> Tuple[str, str]: """Breaks down construct signatures @@ -120,9 +125,10 @@ class JSObject(ObjectDescription): domain = cast(JavaScriptDomain, self.env.get_domain('js')) domain.note_object(fullname, self.objtype, node_id, location=signode) - indextext = self.get_index_text(mod_name, name_obj) - if indextext: - self.indexnode['entries'].append(('single', indextext, node_id, '', None)) + if 'noindexentry' not in self.options: + indextext = self.get_index_text(mod_name, name_obj) + if indextext: + self.indexnode['entries'].append(('single', indextext, node_id, '', None)) def get_index_text(self, objectname: str, name_obj: Tuple[str, str]) -> str: name, obj = name_obj |