docbook: Fix the DocBook section output

The DocBook formatter used to generate something like:

  <para id="section"><sect2><title>Title</title></sect2>Some Text</para>

Which was completely wrong. In DocBook, a section should look like this:

  <sect2 id="section"><title>Title</title><para>Some Text</para></sect2>
This commit is contained in:
Daniel Pfeifer 2012-09-07 10:35:55 +02:00 committed by Brad King
parent dbfe335099
commit 55146ed0f0

View File

@ -120,40 +120,31 @@ void cmDocumentationFormatterDocbook
section.GetEntries(); section.GetEntries();
for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin(); for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin();
op != entries.end();) op != entries.end(); ++op)
{ {
if(op->Name.size()) if(op->Name.size())
{ {
for(;op != entries.end() && op->Name.size(); ++op) os << "<sect2 id=\"";
{
if(op->Name.size())
{
os << " <para id=\"";
this->PrintId(os, prefix.c_str(), op->Name); this->PrintId(os, prefix.c_str(), op->Name);
os << "\"><sect2><title>"; os << "\">\n<title>";
cmDocumentationPrintDocbookEscapes(os, op->Name.c_str()); cmDocumentationPrintDocbookEscapes(os, op->Name.c_str());
os << "</title></sect2> "; os << "</title>\n";
}
cmDocumentationPrintDocbookEscapes(os, op->Brief.c_str());
if(op->Name.size())
{
os << "</para>\n";
}
if(op->Full.size()) if(op->Full.size())
{ {
// a line break seems to be simply a line break with docbook os << "<abstract>\n<para>";
os << "\n "; cmDocumentationPrintDocbookEscapes(os, op->Brief.c_str());
os << "</para>\n</abstract>\n";
this->PrintFormatted(os, op->Full.c_str()); this->PrintFormatted(os, op->Full.c_str());
} }
os << "\n";
}
}
else else
{ {
this->PrintFormatted(os, op->Brief.c_str()); this->PrintFormatted(os, op->Brief.c_str());
os << "\n"; }
++op; os << "</sect2>\n";
}
else
{
this->PrintFormatted(os, op->Brief.c_str());
} }
} }
if(name) if(name)