summaryrefslogtreecommitdiffstats
path: root/Source/cmDocumentationFormatterDocbook.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-05-05 16:02:36 (GMT)
committerBrad King <brad.king@kitware.com>2008-05-05 16:02:36 (GMT)
commit199e85910f9ce308c4c53ffcb0f934706f16c5cd (patch)
tree290fef0ea4992a634e2bd602a5cd73c08c072755 /Source/cmDocumentationFormatterDocbook.cxx
parent1b23b65ed5ff1ea22e912ad25ba94b53e4e91828 (diff)
downloadCMake-199e85910f9ce308c4c53ffcb0f934706f16c5cd.zip
CMake-199e85910f9ce308c4c53ffcb0f934706f16c5cd.tar.gz
CMake-199e85910f9ce308c4c53ffcb0f934706f16c5cd.tar.bz2
ENH: Fix generated documentation internal links.
- Previously all links started in 'command_' which led to conflicts and was confusing for non-command items. - Use a per-section name that is meaningful to humans. - Fix link id names to be valid HTML.
Diffstat (limited to 'Source/cmDocumentationFormatterDocbook.cxx')
-rw-r--r--Source/cmDocumentationFormatterDocbook.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/cmDocumentationFormatterDocbook.cxx b/Source/cmDocumentationFormatterDocbook.cxx
index 65f4bf8..1c648a6 100644
--- a/Source/cmDocumentationFormatterDocbook.cxx
+++ b/Source/cmDocumentationFormatterDocbook.cxx
@@ -129,6 +129,8 @@ void cmDocumentationFormatterDocbook
}
}
+ std::string prefix = this->ComputeSectionLinkPrefix(name);
+
const std::vector<cmDocumentationEntry> &entries =
section.GetEntries();
@@ -138,7 +140,7 @@ void cmDocumentationFormatterDocbook
{
if(op->Name.size())
{
- os << " <listitem><link linkend=\"command_";
+ os << " <listitem><link linkend=\"" << prefix << "_";
cmDocumentationPrintDocbookEscapes(os, op->Name.c_str());
os << "\"><emphasis><literal>";
cmDocumentationPrintDocbookEscapes(os, op->Name.c_str());
@@ -156,15 +158,15 @@ void cmDocumentationFormatterDocbook
{
if(op->Name.size())
{
- os << " <para id=\"command_";
+ os << " <para id=\"" << prefix << "_";
cmDocumentationPrintDocbookEscapes(os, op->Name.c_str());
- // make sure that each id exists only once, e.g.
- // command_COMPILE_DEFINITIONS exists at least twice. Since it seems
+ // make sure that each id exists only once. Since it seems
// not easily possible to determine which link refers to which id,
// we have at least to make sure that the duplicated id's get a
// different name (by appending an increasing number), Alex
- std::string id = "command_";
+ std::string id = prefix;
+ id += "_";
id += op->Name;
if (this->EmittedLinkIds.find(id) == this->EmittedLinkIds.end())
{