diff options
| author | Bill Hoffman <bill.hoffman@kitware.com> | 2008-05-05 17:38:19 (GMT) |
|---|---|---|
| committer | Bill Hoffman <bill.hoffman@kitware.com> | 2008-05-05 17:38:19 (GMT) |
| commit | a00f1beb530c0c9fff8deab150a07b4c3839285b (patch) | |
| tree | 61b229fb9aaa91fdb34622498533ebd25c9160e5 /Source/cmDocumentationFormatter.cxx | |
| parent | f3ca3d139c21aacb75fbe2a7bb8291967d6dab07 (diff) | |
| download | CMake-2.6.0.zip CMake-2.6.0.tar.gz CMake-2.6.0.tar.bz2 | |
ENH: merge in changes for generated docsv2.6.0
Diffstat (limited to 'Source/cmDocumentationFormatter.cxx')
| -rw-r--r-- | Source/cmDocumentationFormatter.cxx | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/Source/cmDocumentationFormatter.cxx b/Source/cmDocumentationFormatter.cxx index 6b6f8d0..9c63323 100644 --- a/Source/cmDocumentationFormatter.cxx +++ b/Source/cmDocumentationFormatter.cxx @@ -71,3 +71,86 @@ void cmDocumentationFormatter::PrintFormatted(std::ostream& os, } } +//---------------------------------------------------------------------------- +std::string +cmDocumentationFormatter::ComputeSectionLinkPrefix(std::string const& name) +{ + // Map from section name to a prefix for links pointing within the + // section. For example, the commands section should have HTML + // links to each command with names like #command:ADD_EXECUTABLE. + if(name.find("Command") != name.npos) + { + return "command"; + } + else if(name.find("Propert") != name.npos) + { + if(name.find("Global") != name.npos) + { + return "prop_global"; + } + else if(name.find("Direct") != name.npos) + { + return "prop_dir"; + } + else if(name.find("Target") != name.npos) + { + return "prop_tgt"; + } + else if(name.find("Test") != name.npos) + { + return "prop_test"; + } + else if(name.find("Source") != name.npos) + { + return "prop_sf"; + } + return "property"; + } + else if(name.find("Variable") != name.npos) + { + return "variable"; + } + else if(name.find("Polic") != name.npos) + { + return "policy"; + } + else if(name.find("Module") != name.npos) + { + return "module"; + } + else if(name.find("Name") != name.npos) + { + return "name"; + } + else if(name.find("Usage") != name.npos) + { + return "usage"; + } + else if(name.find("Description") != name.npos) + { + return "desc"; + } + else if(name.find("Generators") != name.npos) + { + return "gen"; + } + else if(name.find("Options") != name.npos) + { + return "opt"; + } + else if(name.find("Copyright") != name.npos) + { + return "copy"; + } + else if(name.find("See Also") != name.npos) + { + return "see"; + } + else + { + std::cerr + << "WARNING: ComputeSectionLinkPrefix failed for \"" << name << "\"" + << std::endl; + return "other"; + } +} |
