summaryrefslogtreecommitdiffstats
path: root/Source/cmDocumentation.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2003-07-11 03:15:45 (GMT)
committerBrad King <brad.king@kitware.com>2003-07-11 03:15:45 (GMT)
commit7c2b4e3a029ffe1205553fb80883434677167b2c (patch)
tree662fdbc709b4c19f872567e6c8e1a97c744a3e72 /Source/cmDocumentation.cxx
parentc08062795747714b6db50a4261543ff4035dc843 (diff)
downloadCMake-7c2b4e3a029ffe1205553fb80883434677167b2c.zip
CMake-7c2b4e3a029ffe1205553fb80883434677167b2c.tar.gz
CMake-7c2b4e3a029ffe1205553fb80883434677167b2c.tar.bz2
ENH: Added SEE ALSO section to generated man page. Minor formatting improvements for generated text-only documentation.
Diffstat (limited to 'Source/cmDocumentation.cxx')
-rw-r--r--Source/cmDocumentation.cxx49
1 files changed, 36 insertions, 13 deletions
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index fd34e47..d8bc34e 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -342,6 +342,22 @@ void cmDocumentation::SetGeneratorsSection(const cmDocumentationEntry* section)
}
//----------------------------------------------------------------------------
+void cmDocumentation::SetSeeAlsoList(const cmDocumentationEntry* also)
+{
+ this->SeeAlsoString = ".B ";
+ for(const cmDocumentationEntry* i = also; i->brief; ++i)
+ {
+ this->SeeAlsoString += i->brief;
+ this->SeeAlsoString += (i+1)->brief? "(1), ":"(1)";
+ }
+ cmDocumentationEntry e = {0, 0, 0};
+ e.brief = this->SeeAlsoString.c_str();
+ this->SeeAlsoSection.push_back(e);
+ e.brief = 0;
+ this->SeeAlsoSection.push_back(e);
+}
+
+//----------------------------------------------------------------------------
void cmDocumentation::PrintSection(std::ostream& os,
const cmDocumentationEntry* section,
const char* name)
@@ -362,6 +378,9 @@ void cmDocumentation::PrintSectionText(std::ostream& os,
{
if(name)
{
+ os <<
+ "---------------------------------------"
+ "---------------------------------------\n";
os << name << "\n\n";
}
if(!section) { return; }
@@ -772,10 +791,6 @@ void cmDocumentation::PrintDocumentationMan(std::ostream& os)
void cmDocumentation::CreateUsageDocumentation()
{
this->ClearSections();
- if(!this->NameSection.empty())
- {
- this->AddSection("Name", &this->NameSection[0]);
- }
if(!this->UsageSection.empty())
{
this->AddSection("Usage", &this->UsageSection[0]);
@@ -784,6 +799,10 @@ void cmDocumentation::CreateUsageDocumentation()
{
this->AddSection("Command-Line Options", &this->OptionsSection[0]);
}
+ if(!this->GeneratorsSection.empty())
+ {
+ this->AddSection("Generators", &this->GeneratorsSection[0]);
+ }
}
//----------------------------------------------------------------------------
@@ -802,14 +821,14 @@ void cmDocumentation::CreateFullDocumentation()
{
this->AddSection(0, &this->DescriptionSection[0]);
}
- if(!this->GeneratorsSection.empty())
- {
- this->AddSection("Generators", &this->GeneratorsSection[0]);
- }
if(!this->OptionsSection.empty())
{
this->AddSection("Command-Line Options", &this->OptionsSection[0]);
}
+ if(!this->GeneratorsSection.empty())
+ {
+ this->AddSection("Generators", &this->GeneratorsSection[0]);
+ }
if(!this->CommandsSection.empty())
{
this->AddSection("Listfile Commands", &this->CommandsSection[0]);
@@ -834,20 +853,24 @@ void cmDocumentation::CreateManDocumentation()
{
this->AddSection("DESCRIPTION", &this->DescriptionSection[0]);
}
- if(!this->GeneratorsSection.empty())
- {
- this->AddSection("GENERATORS", &this->GeneratorsSection[0]);
- }
if(!this->OptionsSection.empty())
{
this->AddSection("OPTIONS", &this->OptionsSection[0]);
}
+ if(!this->GeneratorsSection.empty())
+ {
+ this->AddSection("GENERATORS", &this->GeneratorsSection[0]);
+ }
if(!this->CommandsSection.empty())
{
this->AddSection("COMMANDS", &this->CommandsSection[0]);
}
this->AddSection("COPYRIGHT", cmDocumentationCopyright);
- this->AddSection("MAILING LIST", cmDocumentationMailingList);
+ this->AddSection("MAILING LIST", cmDocumentationMailingList);
+ if(!this->SeeAlsoSection.empty())
+ {
+ this->AddSection("SEE ALSO", &this->SeeAlsoSection[0]);
+ }
this->AddSection("AUTHOR", cmDocumentationAuthor);
}