diff options
author | Jakob Lykke Andersen <Jakob@caput.dk> | 2020-07-02 17:26:40 +0200 |
---|---|---|
committer | Jakob Lykke Andersen <Jakob@caput.dk> | 2020-07-04 19:34:00 +0200 |
commit | c668500a4b37e5cf3c7015bda8a558ededbcebfe (patch) | |
tree | 1fabdf1c290102d4024ddfe1b172776f08fa7b3f /sphinx/domains/javascript.py | |
parent | 8c82ecbf2c2f7f9d32959f65be17bf2853aab625 (diff) | |
download | sphinx-git-c668500a4b37e5cf3c7015bda8a558ededbcebfe.tar.gz |
Add :noindexentry: option
Fixes sphinx-doc/sphinx#7052
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 |