ENH: add master index into html full help
This commit is contained in:
parent
68bcb056eb
commit
7173f2db0e
|
@ -846,6 +846,9 @@ void cmDocumentation::Print(Form f, std::ostream& os)
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmDocumentation::Print(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)
|
for(unsigned int i=0; i < this->PrintSections.size(); ++i)
|
||||||
{
|
{
|
||||||
std::string name = this->PrintSections[i]->
|
std::string name = this->PrintSections[i]->
|
||||||
|
|
|
@ -59,6 +59,9 @@ public:
|
||||||
const char* name) = 0;
|
const char* name) = 0;
|
||||||
virtual void PrintPreformatted(std::ostream& os, const char* text) = 0;
|
virtual void PrintPreformatted(std::ostream& os, const char* text) = 0;
|
||||||
virtual void PrintParagraph(std::ostream& os, const char* text) = 0;
|
virtual void PrintParagraph(std::ostream& os, const char* text) = 0;
|
||||||
|
virtual void PrintIndex(std::ostream& ,
|
||||||
|
std::vector<const cmDocumentationSection *>&)
|
||||||
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -206,3 +206,18 @@ void cmDocumentationFormatterHTML::PrintHTMLEscapes(std::ostream& os,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cmDocumentationFormatterHTML
|
||||||
|
::PrintIndex(std::ostream& os,
|
||||||
|
std::vector<const cmDocumentationSection *>& sections)
|
||||||
|
{
|
||||||
|
os << "<h2><a name=\"section_Index\"/>Master Index</h2>\n";
|
||||||
|
os << "<ul>\n";
|
||||||
|
for(unsigned int i=0; i < sections.size(); ++i)
|
||||||
|
{
|
||||||
|
std::string name = sections[i]->
|
||||||
|
GetName((this->GetForm()));
|
||||||
|
os << " <li><a href=\"#section_" << name << "\"<b>" << name << "</b></a></li>\n";
|
||||||
|
}
|
||||||
|
os << "</ul>\n";
|
||||||
|
}
|
||||||
|
|
|
@ -37,6 +37,8 @@ public:
|
||||||
const char* name);
|
const char* name);
|
||||||
virtual void PrintPreformatted(std::ostream& os, const char* text);
|
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<const cmDocumentationSection *>&);
|
||||||
private:
|
private:
|
||||||
void PrintHTMLEscapes(std::ostream& os, const char* text);
|
void PrintHTMLEscapes(std::ostream& os, const char* text);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue