diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2012-09-07 08:35:55 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-09-07 14:10:49 (GMT) |
commit | 55146ed0f04732c076c5caece8d8fb762fa24545 (patch) | |
tree | 50b0505fc6fd78610636203c0cf19febf78909e8 | |
parent | dbfe335099bd80e38830846c401d5651c64d15e5 (diff) | |
download | CMake-55146ed0f04732c076c5caece8d8fb762fa24545.zip CMake-55146ed0f04732c076c5caece8d8fb762fa24545.tar.gz CMake-55146ed0f04732c076c5caece8d8fb762fa24545.tar.bz2 |
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>
-rw-r--r-- | Source/cmDocumentationFormatterDocbook.cxx | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/Source/cmDocumentationFormatterDocbook.cxx b/Source/cmDocumentationFormatterDocbook.cxx index a109c53..47ea512 100644 --- a/Source/cmDocumentationFormatterDocbook.cxx +++ b/Source/cmDocumentationFormatterDocbook.cxx @@ -120,40 +120,31 @@ void cmDocumentationFormatterDocbook section.GetEntries(); for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin(); - op != entries.end();) + op != entries.end(); ++op) { if(op->Name.size()) { - for(;op != entries.end() && op->Name.size(); ++op) + os << "<sect2 id=\""; + this->PrintId(os, prefix.c_str(), op->Name); + os << "\">\n<title>"; + cmDocumentationPrintDocbookEscapes(os, op->Name.c_str()); + os << "</title>\n"; + if(op->Full.size()) { - if(op->Name.size()) - { - os << " <para id=\""; - this->PrintId(os, prefix.c_str(), op->Name); - os << "\"><sect2><title>"; - cmDocumentationPrintDocbookEscapes(os, op->Name.c_str()); - os << "</title></sect2> "; - } + os << "<abstract>\n<para>"; cmDocumentationPrintDocbookEscapes(os, op->Brief.c_str()); - if(op->Name.size()) - { - os << "</para>\n"; - } - - if(op->Full.size()) - { - // a line break seems to be simply a line break with docbook - os << "\n "; - this->PrintFormatted(os, op->Full.c_str()); - } - os << "\n"; + os << "</para>\n</abstract>\n"; + this->PrintFormatted(os, op->Full.c_str()); } + else + { + this->PrintFormatted(os, op->Brief.c_str()); + } + os << "</sect2>\n"; } else { this->PrintFormatted(os, op->Brief.c_str()); - os << "\n"; - ++op; } } if(name) |