mirror of
https://github.com/Kitware/CMake.git
synced 2026-08-04 23:00:54 +00:00
cmRST: Fix cmake domain directives with newline before argument
The `signature` directive added by commit 74e3c1d313 (Utilities/Sphinx:
Add a directive to document command signatures, 2023-02-24) will be
commonly used with the form:
.. signature::
some_command(SOME_SIGNATURE)
Docs for this signature.
Drop the assumption that all CMake domain directives are immediately
followed by their argument on the same line.
This commit is contained in:
@@ -21,7 +21,7 @@ cmRST::cmRST(std::ostream& os, std::string docroot)
|
||||
, DocRoot(std::move(docroot))
|
||||
, CMakeDirective("^.. (cmake:)?("
|
||||
"command|envvar|genex|signature|variable"
|
||||
")::[ \t]+([^ \t\n]+)$")
|
||||
")::")
|
||||
, CMakeModuleDirective("^.. cmake-module::[ \t]+([^ \t\n]+)$")
|
||||
, ParsedLiteralDirective("^.. parsed-literal::[ \t]*(.*)$")
|
||||
, CodeBlockDirective("^.. code-block::[ \t]*(.*)$")
|
||||
|
||||
@@ -46,7 +46,8 @@ Bracket Comment Content
|
||||
Bracket Comment Content
|
||||
]
|
||||
|
||||
.. cmake:command:: some_cmd
|
||||
.. cmake:command::
|
||||
some_cmd
|
||||
|
||||
Command some_cmd description.
|
||||
|
||||
@@ -54,7 +55,8 @@ Bracket Comment Content
|
||||
|
||||
Command other_cmd description.
|
||||
|
||||
.. cmake:envvar:: some_var
|
||||
.. cmake:envvar::
|
||||
some_var
|
||||
|
||||
Environment variable some_var description.
|
||||
|
||||
@@ -62,7 +64,8 @@ Bracket Comment Content
|
||||
|
||||
Environment variable other_var description.
|
||||
|
||||
.. cmake:genex:: SOME_GENEX
|
||||
.. cmake:genex::
|
||||
SOME_GENEX
|
||||
|
||||
Generator expression SOME_GENEX description.
|
||||
|
||||
@@ -70,7 +73,8 @@ Bracket Comment Content
|
||||
|
||||
Generator expression $<OTHER_GENEX> description.
|
||||
|
||||
.. cmake:signature:: some_command(SOME_SIGNATURE)
|
||||
.. cmake:signature::
|
||||
some_command(SOME_SIGNATURE)
|
||||
|
||||
Command some_command SOME_SIGNATURE description.
|
||||
|
||||
@@ -78,7 +82,8 @@ Bracket Comment Content
|
||||
|
||||
Command other_command OTHER_SIGNATURE description.
|
||||
|
||||
.. cmake:variable:: some_var
|
||||
.. cmake:variable::
|
||||
some_var
|
||||
|
||||
Variable some_var description.
|
||||
|
||||
|
||||
@@ -49,7 +49,8 @@ Inline literal ``__`` followed by inline link `Link Text <InternalDest_>`_.
|
||||
|
||||
.. cmake-module:: testRSTmod.cmake
|
||||
|
||||
.. cmake:command:: some_cmd
|
||||
.. cmake:command::
|
||||
some_cmd
|
||||
|
||||
Command some_cmd description.
|
||||
|
||||
@@ -57,7 +58,8 @@ Inline literal ``__`` followed by inline link `Link Text <InternalDest_>`_.
|
||||
|
||||
Command other_cmd description.
|
||||
|
||||
.. cmake:envvar:: some_var
|
||||
.. cmake:envvar::
|
||||
some_var
|
||||
|
||||
Environment variable some_var description.
|
||||
|
||||
@@ -65,7 +67,8 @@ Inline literal ``__`` followed by inline link `Link Text <InternalDest_>`_.
|
||||
|
||||
Environment variable other_var description.
|
||||
|
||||
.. cmake:genex:: SOME_GENEX
|
||||
.. cmake:genex::
|
||||
SOME_GENEX
|
||||
|
||||
Generator expression SOME_GENEX description.
|
||||
|
||||
@@ -73,7 +76,8 @@ Inline literal ``__`` followed by inline link `Link Text <InternalDest_>`_.
|
||||
|
||||
Generator expression $<OTHER_GENEX> description.
|
||||
|
||||
.. cmake:signature:: some_command(SOME_SIGNATURE)
|
||||
.. cmake:signature::
|
||||
some_command(SOME_SIGNATURE)
|
||||
|
||||
Command some_command SOME_SIGNATURE description.
|
||||
|
||||
@@ -81,7 +85,8 @@ Inline literal ``__`` followed by inline link `Link Text <InternalDest_>`_.
|
||||
|
||||
Command other_command OTHER_SIGNATURE description.
|
||||
|
||||
.. cmake:variable:: some_var
|
||||
.. cmake:variable::
|
||||
some_var
|
||||
|
||||
Variable some_var description.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user