|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r63917 - in branches/release: libs/iostreams libs/iostreams/doc tools/quickbook tools/quickbook/detail tools/quickbook/doc tools/quickbook/test
From: daniel_james_at_[hidden]
Date: 2010-07-12 04:13:43
Author: danieljames
Date: 2010-07-12 04:13:38 EDT (Mon, 12 Jul 2010)
New Revision: 63917
URL: http://svn.boost.org/trac/boost/changeset/63917
Log:
Merge quickbook, iostreams.
Properties modified:
branches/release/libs/iostreams/ (props changed)
branches/release/tools/quickbook/ (props changed)
Text files modified:
branches/release/libs/iostreams/doc/release_notes.html | 2
branches/release/tools/quickbook/detail/actions.cpp | 113 ++++++++++++++++++++-------------------
branches/release/tools/quickbook/detail/utils.cpp | 7 --
branches/release/tools/quickbook/detail/utils.hpp | 11 ---
branches/release/tools/quickbook/doc/quickbook.qbk | 8 ++
branches/release/tools/quickbook/test/doc-info-1.gold | 4 +
branches/release/tools/quickbook/test/quickbook-manual.gold | 3 +
7 files changed, 72 insertions(+), 76 deletions(-)
Modified: branches/release/libs/iostreams/doc/release_notes.html
==============================================================================
--- branches/release/libs/iostreams/doc/release_notes.html (original)
+++ branches/release/libs/iostreams/doc/release_notes.html 2010-07-12 04:13:38 EDT (Mon, 12 Jul 2010)
@@ -27,7 +27,7 @@
<code>file_descriptor</code>, <code>file_descriptor_source</code>
and <code>file_descriptor_sink</code>. See
<a title="File descriptor devices referece" href="classes/file_descriptor.html">the documentation</a>
- for details. The old methods are still available is you define
+ for details. The old methods are still available if you define
<code>BOOST_IOSTREAMS_USE_DEPRECATED</code>
(#3517).
</li>
Modified: branches/release/tools/quickbook/detail/actions.cpp
==============================================================================
--- branches/release/tools/quickbook/detail/actions.cpp (original)
+++ branches/release/tools/quickbook/detail/actions.cpp 2010-07-12 04:13:38 EDT (Mon, 12 Jul 2010)
@@ -30,6 +30,23 @@
char const* quickbook_get_time = "__quickbook_get_time__";
namespace {
+ char filter_identifier_char(char ch)
+ {
+ if (!std::isalnum(static_cast<unsigned char>(ch)))
+ ch = '_';
+ return static_cast<char>(std::tolower(static_cast<unsigned char>(ch)));
+ }
+
+ template <typename Iterator>
+ inline std::string
+ make_identifier(Iterator const& first, Iterator const& last)
+ {
+ std::string out_name;
+ for (Iterator i = first; i != last; ++i)
+ out_name += filter_identifier_char(*i);
+ return out_name;
+ }
+
std::string fully_qualified_id(std::string const& library_id,
std::string const& qualified_section_id,
std::string const& section_id)
@@ -98,7 +115,7 @@
{
out << "<anchor id=\""
<< section_id << '.'
- << detail::make_identifier(str.begin(), str.end())
+ << make_identifier(str.begin(), str.end())
<< "\" />"
<< pre << str << post
;
@@ -106,8 +123,8 @@
else // version 1.3 and above
{
std::string id = qbk_version_n >= 106 ?
- detail::make_identifier(first, last) :
- detail::make_identifier(str.begin(), str.end());
+ make_identifier(first, last) :
+ make_identifier(str.begin(), str.end());
std::string anchor =
fully_qualified_id(library_id, qualified_section_id, id);
@@ -133,8 +150,8 @@
phrase.swap(str);
std::string id = qbk_version_n >= 106 ?
- detail::make_identifier(first, last) :
- detail::make_identifier(str.begin(), str.end());
+ make_identifier(first, last) :
+ make_identifier(str.begin(), str.end());
std::string anchor =
fully_qualified_id(library_id, qualified_section_id, id);
@@ -1038,7 +1055,7 @@
else if(has_title) {
table_id = fully_qualified_id(actions.doc_id,
actions.qualified_section_id,
- detail::make_identifier(first, last));
+ make_identifier(first, last));
}
}
@@ -1126,7 +1143,7 @@
void begin_section_action::operator()(iterator first, iterator last) const
{
section_id = element_id.empty() ?
- detail::make_identifier(first, last) :
+ make_identifier(first, last) :
element_id;
if (section_level != 0)
@@ -1514,7 +1531,7 @@
// *before* anything else.
if (actions.doc_id.empty())
- actions.doc_id = detail::make_identifier(
+ actions.doc_id = make_identifier(
actions.doc_title.begin(),actions.doc_title.end());
if (actions.doc_dirname.empty() && actions.doc_type == "library")
@@ -1693,64 +1710,50 @@
}
}
- 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")
- {
- 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"
- ;
- }
- }
- else
+ if (actions.doc_type != "library")
{
invalid_attributes.push_back("category");
}
+
+ 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"
+ ;
+ }
}
out << " </" << actions.doc_type << "info>\n"
@@ -1762,7 +1765,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: branches/release/tools/quickbook/detail/utils.cpp
==============================================================================
--- branches/release/tools/quickbook/detail/utils.cpp (original)
+++ branches/release/tools/quickbook/detail/utils.cpp 2010-07-12 04:13:38 EDT (Mon, 12 Jul 2010)
@@ -51,13 +51,6 @@
out << ch;
}
- char filter_identifier_char(char ch)
- {
- if (!std::isalnum(static_cast<unsigned char>(ch)))
- ch = '_';
- return static_cast<char>(std::tolower(static_cast<unsigned char>(ch)));
- }
-
// un-indent a code segment
void unindent(std::string& program)
{
Modified: branches/release/tools/quickbook/detail/utils.hpp
==============================================================================
--- branches/release/tools/quickbook/detail/utils.hpp (original)
+++ branches/release/tools/quickbook/detail/utils.hpp 2010-07-12 04:13:38 EDT (Mon, 12 Jul 2010)
@@ -21,17 +21,6 @@
void print_char(char ch, std::ostream& out);
void print_string(std::basic_string<char> const& str, std::ostream& out);
void print_space(char ch, std::ostream& out);
- char filter_identifier_char(char ch);
-
- template <typename Iterator>
- inline std::string
- make_identifier(Iterator const& first, Iterator const& last)
- {
- std::string out_name;
- for (Iterator i = first; i != last; ++i)
- out_name += filter_identifier_char(*i);
- return out_name;
- }
template <typename T>
struct var_wrapper
Modified: branches/release/tools/quickbook/doc/quickbook.qbk
==============================================================================
--- branches/release/tools/quickbook/doc/quickbook.qbk (original)
+++ branches/release/tools/quickbook/doc/quickbook.qbk 2010-07-12 04:13:38 EDT (Mon, 12 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: branches/release/tools/quickbook/test/doc-info-1.gold
==============================================================================
--- branches/release/tools/quickbook/test/doc-info-1.gold (original)
+++ branches/release/tools/quickbook/test/doc-info-1.gold 2010-07-12 04:13:38 EDT (Mon, 12 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: branches/release/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
==============================================================================
--- branches/release/tools/quickbook/test/quickbook-manual.gold (original)
+++ branches/release/tools/quickbook/test/quickbook-manual.gold 2010-07-12 04:13:38 EDT (Mon, 12 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>