|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r63896 - in trunk/tools/quickbook: detail doc test
From: daniel_james_at_[hidden]
Date: 2010-07-11 19:15:19
Author: danieljames
Date: 2010-07-11 19:15:18 EDT (Sun, 11 Jul 2010)
New Revision: 63896
URL: http://svn.boost.org/trac/boost/changeset/63896
Log:
Restore the invalid doc info attributes.
Removing them breaks the release notes, there's still a warning that
they're invalid. Refs #1281
Text files modified:
trunk/tools/quickbook/detail/actions.cpp | 78 ++++++++++++++++-----------------------
trunk/tools/quickbook/doc/quickbook.qbk | 8 +++-
trunk/tools/quickbook/test/doc-info-1.gold | 4 ++
trunk/tools/quickbook/test/quickbook-manual.gold | 3 +
4 files changed, 45 insertions(+), 48 deletions(-)
Modified: trunk/tools/quickbook/detail/actions.cpp
==============================================================================
--- trunk/tools/quickbook/detail/actions.cpp (original)
+++ trunk/tools/quickbook/detail/actions.cpp 2010-07-11 19:15:18 EDT (Sun, 11 Jul 2010)
@@ -1693,63 +1693,49 @@
}
}
- if (qbk_version_n < 103)
+ if (!actions.doc_purpose.empty())
{
- if (!actions.doc_purpose_1_1.empty())
+ if (actions.doc_type != "library")
{
- if (actions.doc_type == "library")
- {
- out << " <" << actions.doc_type << "purpose>\n"
- << " ";
- detail::print_string(actions.doc_purpose_1_1, out.get());
- out << " </" << actions.doc_type << "purpose>\n"
- << "\n"
- ;
- }
- else
- {
- invalid_attributes.push_back("purpose");
- }
+ invalid_attributes.push_back("purpose");
}
- }
- else
- {
- if (!actions.doc_purpose.empty())
+
+ if (qbk_version_n < 103)
{
- if (actions.doc_type == "library")
- {
- out << " <" << actions.doc_type << "purpose>\n"
- << " " << actions.doc_purpose
- << " </" << actions.doc_type << "purpose>\n"
- << "\n"
- ;
- }
- else
- {
- invalid_attributes.push_back("purpose");
- }
+ out << " <" << actions.doc_type << "purpose>\n"
+ << " ";
+ detail::print_string(actions.doc_purpose_1_1, out.get());
+ out << " </" << actions.doc_type << "purpose>\n"
+ << "\n"
+ ;
+ }
+ else
+ {
+ out << " <" << actions.doc_type << "purpose>\n"
+ << " " << actions.doc_purpose
+ << " </" << actions.doc_type << "purpose>\n"
+ << "\n"
+ ;
}
}
if (!actions.doc_categories.empty())
{
- if (actions.doc_type == "library")
+ if (actions.doc_type != "library")
{
- for(actions::string_list::const_iterator
- it = actions.doc_categories.begin(),
- end = actions.doc_categories.end();
- it != end; ++it)
- {
- out << " <" << actions.doc_type << "category name=\"category:";
- detail::print_string(*it, out.get());
- out << "\"></" << actions.doc_type << "category>\n"
- << "\n"
- ;
- }
+ invalid_attributes.push_back("category");
}
- else
+
+ for(actions::string_list::const_iterator
+ it = actions.doc_categories.begin(),
+ end = actions.doc_categories.end();
+ it != end; ++it)
{
- invalid_attributes.push_back("category");
+ out << " <" << actions.doc_type << "category name=\"category:";
+ detail::print_string(*it, out.get());
+ out << "\"></" << actions.doc_type << "category>\n"
+ << "\n"
+ ;
}
}
@@ -1762,7 +1748,7 @@
detail::outwarn(actions.filename.file_string(),1)
<< (invalid_attributes.size() > 1 ?
"Invalid attributes" : "Invalid attribute")
- << " for '" << actions.doc_type << "': "
+ << " for '" << actions.doc_type << " document info': "
<< boost::algorithm::join(invalid_attributes, ", ")
<< "\n"
;
Modified: trunk/tools/quickbook/doc/quickbook.qbk
==============================================================================
--- trunk/tools/quickbook/doc/quickbook.qbk (original)
+++ trunk/tools/quickbook/doc/quickbook.qbk 2010-07-11 19:15:18 EDT (Sun, 11 Jul 2010)
@@ -196,8 +196,7 @@
* XML encode the documentation info correctly.
* Avoid generating empty paragraphs.
* No longer wraps block templates in paragraphs.
- * Doesn't generate invalid doc_info members for docbook document types,
- warns if you use any.
+ * Warns if you use invalid doc_info members for docbook document types.
* Fixes some other causes of invalid boostbook, although it still
generates invalid boostbook in places.
* Improved grammar:
@@ -801,6 +800,11 @@
=version=, =id=, =dirname=, =copyright=, =purpose=, =category=, =authors=,
=license=, =last-revision= and =source-mode= are optional information.
+=dirname=, =purpose= and =category= are boostbook attributes which are only
+valid for =library= documents. If you use them for other document types,
+quickbook will warn about them, but still use them, generating invalid markup,
+that's just ignored by the style sheets.
+
=source-type= is a lowercase string setting the initial __source_mode__. If
the =source-mode= field is omitted, a default value of =c++= will be used.
Modified: trunk/tools/quickbook/test/doc-info-1.gold
==============================================================================
--- trunk/tools/quickbook/test/doc-info-1.gold (original)
+++ trunk/tools/quickbook/test/doc-info-1.gold 2010-07-11 19:15:18 EDT (Sun, 11 Jul 2010)
@@ -12,5 +12,9 @@
<firstname>Jane</firstname> <surname>Doe</surname>
</author>
</authorgroup>
+ <articlepurpose>
+ Inline code test: <code>1 + 2</code>
+ </articlepurpose>
+ <articlecategory name="category:tests"></articlecategory> <articlecategory name="category:irrelevance"></articlecategory>
</articleinfo>
</article>
Modified: trunk/tools/quickbook/test/quickbook-manual.gold
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk
==============================================================================
--- trunk/tools/quickbook/test/quickbook-manual.gold (original)
+++ trunk/tools/quickbook/test/quickbook-manual.gold 2010-07-11 19:15:18 EDT (Sun, 11 Jul 2010)
@@ -21,6 +21,9 @@
file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt>)
</para>
</legalnotice>
+ <articlepurpose>
+ <emphasis>WikiWiki</emphasis> style documentation tool
+ </articlepurpose>
</articleinfo>
<section id="quickbook.intro">
<title><link linkend="quickbook.intro"> Introduction</link></title>