diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx index fca5b3e5e..3b3dab736 100644 --- a/Source/cmDocumentation.cxx +++ b/Source/cmDocumentation.cxx @@ -846,6 +846,9 @@ void cmDocumentation::Print(Form f, std::ostream& os) //---------------------------------------------------------------------------- void cmDocumentation::Print(std::ostream& os) { + // if the formatter supports it, print a master index for + // all sections + this->CurrentFormatter->PrintIndex(os, this->PrintSections); for(unsigned int i=0; i < this->PrintSections.size(); ++i) { std::string name = this->PrintSections[i]-> diff --git a/Source/cmDocumentationFormatter.h b/Source/cmDocumentationFormatter.h index 451215fc7..33f95f235 100644 --- a/Source/cmDocumentationFormatter.h +++ b/Source/cmDocumentationFormatter.h @@ -59,6 +59,9 @@ public: const char* name) = 0; virtual void PrintPreformatted(std::ostream& os, const char* text) = 0; virtual void PrintParagraph(std::ostream& os, const char* text) = 0; + virtual void PrintIndex(std::ostream& , + std::vector&) + {} }; #endif diff --git a/Source/cmDocumentationFormatterHTML.cxx b/Source/cmDocumentationFormatterHTML.cxx index 0c44ed7bc..c3b0dee88 100644 --- a/Source/cmDocumentationFormatterHTML.cxx +++ b/Source/cmDocumentationFormatterHTML.cxx @@ -206,3 +206,18 @@ void cmDocumentationFormatterHTML::PrintHTMLEscapes(std::ostream& os, } } } + +void cmDocumentationFormatterHTML +::PrintIndex(std::ostream& os, + std::vector& sections) +{ + os << "

Master Index

\n"; + os << "\n"; +} diff --git a/Source/cmDocumentationFormatterHTML.h b/Source/cmDocumentationFormatterHTML.h index 58c243769..8e639c739 100644 --- a/Source/cmDocumentationFormatterHTML.h +++ b/Source/cmDocumentationFormatterHTML.h @@ -36,7 +36,9 @@ public: const cmDocumentationSection& section, const char* name); virtual void PrintPreformatted(std::ostream& os, const char* text); - virtual void PrintParagraph(std::ostream& os, const char* text); + virtual void PrintParagraph(std::ostream& os, const char* text); + virtual void PrintIndex(std::ostream& , + std::vector&); private: void PrintHTMLEscapes(std::ostream& os, const char* text); };