diff options
author | Brad King <brad.king@kitware.com> | 2013-09-12 14:05:46 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-10-15 14:47:39 (GMT) |
commit | f85405f5515ed5cc20ffe97c485d7dfef6ffc288 (patch) | |
tree | 82ad6c306db15100c3afa4836aefb9ae74e372a7 /Source/cmDocumentationFormatter.cxx | |
parent | 0d0fec152443fa3f63af8e68e3b2784b6523d85d (diff) | |
download | CMake-f85405f5515ed5cc20ffe97c485d7dfef6ffc288.zip CMake-f85405f5515ed5cc20ffe97c485d7dfef6ffc288.tar.gz CMake-f85405f5515ed5cc20ffe97c485d7dfef6ffc288.tar.bz2 |
Add reStructuredText (RST) documentation formatter
Temporarily add a RST formatter to convert builtin documentation to .rst
source files. This will be removed shortly after we use it to convert
documentation.
Teach the RST formatter to:
* Output preformatted blocks as reStructuredText "::" literal blocks.
* Output option lists as bullet lists with option names enclosed in
reStructuredText ``literal`` quoting.
* Output individual documentation objects (commands, variables, etc.)
in separate .rst files organized in directories by type.
Replace references to cmVersion::GetCMakeVersion() in builtin
documentation with the literal placeholder "|release|" that will be
defined as a substitution later.
Diffstat (limited to 'Source/cmDocumentationFormatter.cxx')
-rw-r--r-- | Source/cmDocumentationFormatter.cxx | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/Source/cmDocumentationFormatter.cxx b/Source/cmDocumentationFormatter.cxx index 9f01949..a547176 100644 --- a/Source/cmDocumentationFormatter.cxx +++ b/Source/cmDocumentationFormatter.cxx @@ -81,7 +81,7 @@ cmDocumentationFormatter::ComputeSectionLinkPrefix(std::string const& name) { if(name.find("Global") != name.npos) { - return "prop_global"; + return "prop_gbl"; } else if(name.find("Direct") != name.npos) { @@ -99,10 +99,34 @@ cmDocumentationFormatter::ComputeSectionLinkPrefix(std::string const& name) { return "prop_sf"; } + else if(name.find("Cache") != name.npos) + { + return "prop_cache"; + } return "property"; } else if(name.find("Variable") != name.npos) { + if(name.find("Information") != name.npos) + { + return "var_info"; + } + else if(name.find("Behavior") != name.npos) + { + return "var_cmake"; + } + else if(name.find("Describe") != name.npos) + { + return "var_sys"; + } + else if(name.find("Control") != name.npos) + { + return "var_build"; + } + else if(name.find("Languages") != name.npos) + { + return "var_lang"; + } return "variable"; } else if(name.find("Polic") != name.npos) @@ -128,7 +152,7 @@ cmDocumentationFormatter::ComputeSectionLinkPrefix(std::string const& name) } else if(name.find("Generators") != name.npos) { - return "gen"; + return "generator"; } else if(name.find("Options") != name.npos) { |