diff options
| author | Théo Zimmermann | 2020-04-20 13:26:40 +0200 |
|---|---|---|
| committer | Théo Zimmermann | 2020-04-20 13:26:40 +0200 |
| commit | 078e6c6d27bc3a13bb9e7ac6c9c5b8e05450af80 (patch) | |
| tree | b5b1880cf7f12d6fa2ef40bf0263e66266f4169d /doc | |
| parent | b669ca8459f5d0fec2201c494d88c7d516c37be0 (diff) | |
| parent | 796878d827693fefdfe4901af7a71bfe20f2011c (diff) | |
Merge PR #12123: Don't create index entries for the name "_"
Reviewed-by: cpitclaudel
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/tools/coqrst/coqdomain.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/doc/tools/coqrst/coqdomain.py b/doc/tools/coqrst/coqdomain.py index b448d0f9d3..57243207f0 100644 --- a/doc/tools/coqrst/coqdomain.py +++ b/doc/tools/coqrst/coqdomain.py @@ -188,20 +188,19 @@ class CoqObject(ObjectDescription): def _add_index_entry(self, name, target): """Add `name` (pointing to `target`) to the main index.""" assert isinstance(name, str) - if not name.startswith("_"): - # remove trailing . , found in commands, but not ... (ellipsis) - trim = name.endswith(".") and not name.endswith("...") - index_text = name[:-1] if trim else name - if self.index_suffix: - index_text += " " + self.index_suffix - self.indexnode['entries'].append(('single', index_text, target, '', None)) + # remove trailing . , found in commands, but not ... (ellipsis) + trim = name.endswith(".") and not name.endswith("...") + index_text = name[:-1] if trim else name + if self.index_suffix: + index_text += " " + self.index_suffix + self.indexnode['entries'].append(('single', index_text, target, '', None)) aliases = None # additional indexed names for a command or other object def add_target_and_index(self, name, _, signode): """Attach a link target to `signode` and an index entry for `name`. This is only called (from ``ObjectDescription.run``) if ``:noindex:`` isn't specified.""" - if name: + if name and not (isinstance(name, str) and name.startswith('_')): target = self._add_target(signode, name) self._add_index_entry(name, target) if self.aliases is not None: |
