diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2012-09-07 08:41:49 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-09-07 14:11:27 (GMT) |
commit | 67e7d49cb8e226221b46ce9182d9620fa3efcb63 (patch) | |
tree | 5cce80259e8d82589bdeb499385f9ab0cc4b7d98 | |
parent | 55146ed0f04732c076c5caece8d8fb762fa24545 (diff) | |
download | CMake-67e7d49cb8e226221b46ce9182d9620fa3efcb63.zip CMake-67e7d49cb8e226221b46ce9182d9620fa3efcb63.tar.gz CMake-67e7d49cb8e226221b46ce9182d9620fa3efcb63.tar.bz2 |
docbook: Cleanup formatter and generated DocBook
Comment and whitespace changes, changed docbook version to 4.5, changed
<literallayout> to <programlisting> (the latter implies a fixed-size font).
-rw-r--r-- | Source/cmDocumentationFormatterDocbook.cxx | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/Source/cmDocumentationFormatterDocbook.cxx b/Source/cmDocumentationFormatterDocbook.cxx index 47ea512..51b93ae 100644 --- a/Source/cmDocumentationFormatterDocbook.cxx +++ b/Source/cmDocumentationFormatterDocbook.cxx @@ -96,28 +96,24 @@ void cmDocumentationPrintDocbookEscapes(std::ostream& os, const char* text) } } - +//---------------------------------------------------------------------------- cmDocumentationFormatterDocbook::cmDocumentationFormatterDocbook() :cmDocumentationFormatter() { } +//---------------------------------------------------------------------------- void cmDocumentationFormatterDocbook ::PrintSection(std::ostream& os, const cmDocumentationSection §ion, const char* name) { - if(name) - { - os << "<sect1 id=\""; - this->PrintId(os, 0, name); - os << "\">\n<title>" << name << "</title>\n"; - } + os << "<sect1 id=\""; + this->PrintId(os, 0, name); + os << "\">\n<title>" << name << "</title>\n"; std::string prefix = this->ComputeSectionLinkPrefix(name); - - const std::vector<cmDocumentationEntry> &entries = - section.GetEntries(); + const std::vector<cmDocumentationEntry> &entries = section.GetEntries(); for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin(); op != entries.end(); ++op) @@ -147,32 +143,36 @@ void cmDocumentationFormatterDocbook this->PrintFormatted(os, op->Brief.c_str()); } } - if(name) + + // empty sections are not allowed in docbook. + if(entries.empty()) { - os << "</sect1>\n"; + os << "<para/>\n"; } + + os << "</sect1>\n"; } -void cmDocumentationFormatterDocbook::PrintPreformatted(std::ostream& os, - const char* text) +//---------------------------------------------------------------------------- +void cmDocumentationFormatterDocbook +::PrintPreformatted(std::ostream& os, const char* text) { - os << "<literallayout>"; + os << "<programlisting>"; cmDocumentationPrintDocbookEscapes(os, text); - os << "</literallayout>\n "; + os << "</programlisting>\n"; } -void cmDocumentationFormatterDocbook::PrintParagraph(std::ostream& os, - const char* text) +void cmDocumentationFormatterDocbook +::PrintParagraph(std::ostream& os, const char* text) { os << "<para>"; cmDocumentationPrintDocbookEscapes(os, text); - os << "</para>"; + os << "</para>\n"; } //---------------------------------------------------------------------------- -void cmDocumentationFormatterDocbook::PrintHeader(const char* docname, - const char* appname, - std::ostream& os) +void cmDocumentationFormatterDocbook +::PrintHeader(const char* docname, const char* appname, std::ostream& os) { this->docname = docname; @@ -182,8 +182,8 @@ void cmDocumentationFormatterDocbook::PrintHeader(const char* docname, this->EmittedLinkIds.clear(); os << "<?xml version=\"1.0\" ?>\n" - "<!DOCTYPE article PUBLIC \"-//OASIS//DTD DocBook V4.2//EN\" " - "\"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd\" [\n" + "<!DOCTYPE article PUBLIC \"-//OASIS//DTD DocBook V4.5//EN\" " + "\"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd\" [\n" "<!ENTITY % addindex \"IGNORE\">\n" "<!ENTITY % English \"INCLUDE\"> ]>\n" "<article>\n" |