summaryrefslogtreecommitdiff
path: root/Help
diff options
context:
space:
mode:
authorMatthew Woehlke <matthew.woehlke@kitware.com>2023-03-09 11:32:07 -0500
committerMatthew Woehlke <matthew.woehlke@kitware.com>2023-03-09 11:32:07 -0500
commitcc21d0e47802fb1d054eb56b8bb4bd8ee66f9caa (patch)
tree0a63ab5ce52622dae91def59212c39ffb942eb4f /Help
parent37e015d4a65566386266a99c70226b4082defce2 (diff)
downloadcmake-cc21d0e47802fb1d054eb56b8bb4bd8ee66f9caa.tar.gz
Utilities/Sphinx: Make signatures linkable
Add signatures to the collection of observed objects (which can be referenced elsewhere). Don't automatically strip parameters from a :command: reference, as these may now link signatures. (Do, however, munge them into 'text <ref>' form if they aren't already, as not doing so adds an extra '()' for some reason.) Correspondingly, change xref resolution to try to match 'command' when a ref like 'command(args)' is not matched, so that existing links to commands that have not been converted to use the new signature directive don't immediately break.
Diffstat (limited to 'Help')
-rw-r--r--Help/dev/documentation.rst6
1 files changed, 3 insertions, 3 deletions
diff --git a/Help/dev/documentation.rst b/Help/dev/documentation.rst
index a340739c1b..8cd71b40cd 100644
--- a/Help/dev/documentation.rst
+++ b/Help/dev/documentation.rst
@@ -270,8 +270,7 @@ The ``signature`` directive requires one argument, the signature summary:
abbreviate it in the ``signature`` directive argument and specify the full
signature in a ``code-block`` in the description.
-The ``signature`` directive generates a document-local hyperlink target
-for each signature:
+The ``signature`` directive generates a hyperlink target for each signature:
* Default target names are automatically extracted from leading "keyword"
arguments in the signatures, where a keyword is any sequence of
@@ -299,7 +298,8 @@ for each signature:
* The targets may be referenced from within the same document using
```REF`_`` or ```TEXT <REF_>`_`` syntax. Like reStructuredText section
- headers, the targets do not work with Sphinx ``:ref:`` syntax.
+ headers, the targets do not work with Sphinx ``:ref:`` syntax, however
+ they can be globally referenced using e.g. ``:command:`string(APPEND)```.
The directive treats its content as the documentation of the signature(s).
Indent the signature documentation accordingly.