aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Pit-Claudel2018-05-17 22:30:53 -0400
committerThéo Zimmermann2018-09-20 10:12:55 +0200
commit468815006f1c272a6ada7186186f90a6692d2521 (patch)
tree5a5e40c28fb06c705a23437721e96cbdd4ce5dac
parent48662f95c63a02d90630941aace96e7b44dcc247 (diff)
[doc] Work around https://github.com/sphinx-doc/sphinx/issues/4979
-rw-r--r--doc/sphinx/proof-engine/proof-handling.rst7
-rw-r--r--doc/tools/coqrst/coqdomain.py11
2 files changed, 14 insertions, 4 deletions
diff --git a/doc/sphinx/proof-engine/proof-handling.rst b/doc/sphinx/proof-engine/proof-handling.rst
index 53294bf8da..3c0577b8e4 100644
--- a/doc/sphinx/proof-engine/proof-handling.rst
+++ b/doc/sphinx/proof-engine/proof-handling.rst
@@ -441,7 +441,12 @@ The following example script illustrates all these features:
You tried to apply a tactic but no goals were under focus.
Using :n:`@bullet` is mandatory here.
-.. exn:: No such goal. Try unfocusing with %{.
+.. FIXME: the :noindex: below works around a Sphinx issue.
+ (https://github.com/sphinx-doc/sphinx/issues/4979)
+ It should be removed once that issue is fixed.
+
+.. exn:: No such goal. Try unfocusing with %}.
+ :noindex:
You just finished a goal focused by ``{``, you must unfocus it with ``}``.
diff --git a/doc/tools/coqrst/coqdomain.py b/doc/tools/coqrst/coqdomain.py
index 1ae2a4a19f..6317e6e214 100644
--- a/doc/tools/coqrst/coqdomain.py
+++ b/doc/tools/coqrst/coqdomain.py
@@ -110,7 +110,9 @@ class CoqObject(ObjectDescription):
# Explicit object naming
'name': directives.unchanged,
# Silence warnings produced by report_undocumented_coq_objects
- 'undocumented': directives.flag
+ 'undocumented': directives.flag,
+ # noindex omits this object from its index
+ 'noindex': directives.flag
}
def subdomain_data(self):
@@ -174,13 +176,16 @@ class CoqObject(ObjectDescription):
"""Add `name` (pointing to `target`) to the main index."""
assert isinstance(name, str)
if not name.startswith("_"):
- index_text = name
+ # 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))
def add_target_and_index(self, name, _, signode):
- """Attach a link target to `signode` and an index entry for `name`."""
+ """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:
target = self._add_target(signode, name)
self._add_index_entry(name, target)