Skip to content

Commit

Permalink
[doc] Work around sphinx-doc/sphinx#4979
Browse files Browse the repository at this point in the history
  • Loading branch information
cpitclaudel committed Aug 7, 2018
1 parent c77be11 commit 2de1054
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
7 changes: 6 additions & 1 deletion doc/sphinx/proof-engine/proof-handling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,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 ``}``.

Expand Down
14 changes: 8 additions & 6 deletions doc/tools/coqrst/coqdomain.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ def _render_signature(self, signature, signode):
# 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):
Expand Down Expand Up @@ -166,18 +168,18 @@ def _add_target(self, signode, name):

def _add_index_entry(self, name, target):
"""Add `name` (pointing to `target`) to the main index."""
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)
# remove trailing . , found in commands, but not ... (ellipsis)
if name[-1] == "." and not name[-3:] == "..." :
name = name[0:-1]
self._add_index_entry(name, target)
return target

Expand Down

0 comments on commit 2de1054

Please sign in to comment.