summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorMatthew Woehlke <matthew.woehlke@kitware.com>2023-03-14 19:20:47 (GMT)
committerMatthew Woehlke <matthew.woehlke@kitware.com>2023-03-14 19:20:47 (GMT)
commit302f5171d8bc9877fc1e9b34024d5c0322f53a69 (patch)
treeae93ba361561e44f27071d3e4dbd13a074e96629 /Tests
parentbc77ddb90ce7fd29c6100dbf352c9b3c8ed287f0 (diff)
downloadCMake-302f5171d8bc9877fc1e9b34024d5c0322f53a69.zip
CMake-302f5171d8bc9877fc1e9b34024d5c0322f53a69.tar.gz
CMake-302f5171d8bc9877fc1e9b34024d5c0322f53a69.tar.bz2
Utilities/Sphinx: Add 'cref' role
Add a role that can be used to create local links (a la '`LINK`_'), but that also applies literal style. This is particularly useful for referring to subcommands within the command's documentation in a style that is consistent with ':command:`BAR <foo(BAR)>`' but is much less verbose. Although this is intended for subcommands, it works with any local reference. Co-authored-by: Brad King <brad.king@kitware.com>
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLib/testRST.expect7
-rw-r--r--Tests/CMakeLib/testRST.rst7
2 files changed, 12 insertions, 2 deletions
diff --git a/Tests/CMakeLib/testRST.expect b/Tests/CMakeLib/testRST.expect
index 483e220..424b7d4 100644
--- a/Tests/CMakeLib/testRST.expect
+++ b/Tests/CMakeLib/testRST.expect
@@ -26,10 +26,15 @@ Generator expression ``$<SOME_GENEX:...>`` with brackets and parameter.
Generator expression ``some genex`` with space and target.
Generator expression ``$<SOME_GENEX>`` with brackets, space, and target.
Generator expression ``$<SOME_GENEX:...>`` with brackets, parameter, space, and target.
-Inline literal ``~!@#$%^&*( )_+-=\\[]{}'":;,<>.?/``.
+Inline cref ``Link Dest``.
+Inline cref ``Link_Dest_<Placeholder>``.
+Inline cref ``Link Text``.
+Inline cref ``Link_Text_<Placeholder>``.
+Inline link Link Dest.
Inline link Link Text.
Inline link Link Text <With \-escaped Brackets>.
Inline literal ``__`` followed by inline link Link Text.
+Inline literal ``~!@#$%^&*( )_+-=\\[]{}'":;,<>.?/``.
First TOC entry.
diff --git a/Tests/CMakeLib/testRST.rst b/Tests/CMakeLib/testRST.rst
index c23b69a..3a38407 100644
--- a/Tests/CMakeLib/testRST.rst
+++ b/Tests/CMakeLib/testRST.rst
@@ -33,10 +33,15 @@ Generator expression :genex:`$<SOME_GENEX:...>` with brackets and parameter.
Generator expression :genex:`some genex <SOME_GENEX>` with space and target.
Generator expression :genex:`$<SOME_GENEX> <SOME_GENEX>` with brackets, space, and target.
Generator expression :genex:`$<SOME_GENEX:...> <SOME_GENEX>` with brackets, parameter, space, and target.
-Inline literal ``~!@#$%^&*( )_+-=\\[]{}'":;,<>.?/``.
+Inline cref :cref:`Link Dest`.
+Inline cref :cref:`Link_Dest_<Placeholder>`.
+Inline cref :cref:`Link Text <ExternalDest>`.
+Inline cref :cref:`Link_Text_<Placeholder> <ExternalDest>`.
+Inline link `Link Dest`_.
Inline link `Link Text <ExternalDest>`_.
Inline link `Link Text \<With \\-escaped Brackets\> <ExternalDest>`_.
Inline literal ``__`` followed by inline link `Link Text <InternalDest_>`_.
+Inline literal ``~!@#$%^&*( )_+-=\\[]{}'":;,<>.?/``.
.. |not replaced| replace:: not replaced through toctree
.. |not replaced in literal| replace:: replaced in parsed literal