[Cmake-commits] CMake branch, next, updated. v2.8.12-4751-gcdce590
Brad King
brad.king at kitware.com
Fri Nov 1 11:51:24 EDT 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via cdce5905bfb6207197b5186b2d570d7d207a6829 (commit)
via 450b515ad0e94155061e3a9d43fcbab53bf7ac80 (commit)
from 603b35b157dc6cf883f00d1122e259a3dd78fc38 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cdce5905bfb6207197b5186b2d570d7d207a6829
commit cdce5905bfb6207197b5186b2d570d7d207a6829
Merge: 603b35b 450b515
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Nov 1 11:51:20 2013 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Nov 1 11:51:20 2013 -0400
Merge topic 'doc-rst-note-and-productionlist' into next
450b515 cmRST: Add support for the note and productionlist directives
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=450b515ad0e94155061e3a9d43fcbab53bf7ac80
commit 450b515ad0e94155061e3a9d43fcbab53bf7ac80
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Oct 29 16:18:29 2013 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Wed Oct 30 10:26:29 2013 -0400
cmRST: Add support for the note and productionlist directives
Simply print out the lines as normal paragraph text. Teach the
CMakeLib.testRST test to cover this syntax. Update the
cmake-developer.7 manual to document support for the directives.
diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst
index ee2016f..5d20c54 100644
--- a/Help/manual/cmake-developer.7.rst
+++ b/Help/manual/cmake-developer.7.rst
@@ -68,11 +68,21 @@ literal block after ``::``
space. We prefer the ``::`` to appear at the end of a paragraph
line instead of as its own line.
+``note`` directive
+ Call out a side note. The command-line help processor prints the
+ block content as if the lines were normal paragraph text with
+ interpretation.
+
``parsed-literal`` directive
Add a literal block with markup interpretation. The command-line
help processor prints the block content without the leading
directive line and with common indentation replaced by one space.
+``productionlist`` directive
+ Render context-free grammar productions. The command-line help
+ processor prints the block content as if the lines were normal
+ paragraph text with interpretation.
+
``replace`` directive
Define a ``|substitution|`` replacement.
The command-line help processor requires a substitution replacement
diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx
index 6d4e281..3aa8e1b 100644
--- a/Source/cmRST.cxx
+++ b/Source/cmRST.cxx
@@ -34,6 +34,8 @@ cmRST::cmRST(std::ostream& os, std::string const& docroot):
ReplaceDirective("^.. (\\|[^|]+\\|) replace::[ \t]*(.*)$"),
IncludeDirective("^.. include::[ \t]+([^ \t\n]+)$"),
TocTreeDirective("^.. toctree::[ \t]*(.*)$"),
+ ProductionListDirective("^.. productionlist::[ \t]*(.*)$"),
+ NoteDirective("^.. note::[ \t]*(.*)$"),
ModuleRST("^#\\[(=*)\\[\\.rst:$"),
CMakeRole("(:cmake)?:("
"command|generator|variable|module|policy|"
@@ -227,6 +229,16 @@ void cmRST::ProcessLine(std::string const& line)
this->Directive = DirectiveTocTree;
this->MarkupLines.push_back(this->TocTreeDirective.match(1));
}
+ else if(this->ProductionListDirective.find(line))
+ {
+ // Output productionlist directives and their content normally.
+ this->NormalLine(line);
+ }
+ else if(this->NoteDirective.find(line))
+ {
+ // Output note directives and their content normally.
+ this->NormalLine(line);
+ }
}
// An explicit markup start followed nothing but whitespace and a
// blank line does not consume any indented text following.
diff --git a/Source/cmRST.h b/Source/cmRST.h
index fa987cd..3356008 100644
--- a/Source/cmRST.h
+++ b/Source/cmRST.h
@@ -84,6 +84,8 @@ private:
cmsys::RegularExpression ReplaceDirective;
cmsys::RegularExpression IncludeDirective;
cmsys::RegularExpression TocTreeDirective;
+ cmsys::RegularExpression ProductionListDirective;
+ cmsys::RegularExpression NoteDirective;
cmsys::RegularExpression ModuleRST;
cmsys::RegularExpression CMakeRole;
cmsys::RegularExpression Substitution;
diff --git a/Tests/CMakeLib/testRST.expect b/Tests/CMakeLib/testRST.expect
index 744cb88..fa436cb 100644
--- a/Tests/CMakeLib/testRST.expect
+++ b/Tests/CMakeLib/testRST.expect
@@ -76,6 +76,13 @@ or after a paragraph ending in two colons::
but not after a line ending in two colons::
in the middle of a paragraph.
+.. productionlist::
+ grammar: `production`
+ production: "content rendered"
+
+.. note::
+ Notes are called out.
+
substituted text with multiple lines becomes one line
End of first include.
diff --git a/Tests/CMakeLib/testRST.rst b/Tests/CMakeLib/testRST.rst
index 5cb6d91..54952dd 100644
--- a/Tests/CMakeLib/testRST.rst
+++ b/Tests/CMakeLib/testRST.rst
@@ -83,6 +83,13 @@ or after a paragraph ending in two colons::
but not after a line ending in two colons::
in the middle of a paragraph.
+.. productionlist::
+ grammar: `production`
+ production: "content rendered"
+
+.. note::
+ Notes are called out.
+
.. |substitution| replace::
|nested substitution|
with multiple lines becomes one line
-----------------------------------------------------------------------
Summary of changes:
Help/manual/cmake-developer.7.rst | 10 ++++++++++
Source/cmRST.cxx | 12 ++++++++++++
Source/cmRST.h | 2 ++
Tests/CMakeLib/testRST.expect | 7 +++++++
Tests/CMakeLib/testRST.rst | 7 +++++++
5 files changed, 38 insertions(+), 0 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list