$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r62471 - in trunk/tools/quickbook: . detail doc test
From: daniel_james_at_[hidden]
Date: 2010-06-06 03:23:46
Author: danieljames
Date: 2010-06-06 03:23:44 EDT (Sun, 06 Jun 2010)
New Revision: 62471
URL: http://svn.boost.org/trac/boost/changeset/62471
Log:
Support multiple categories. Refs #1200.
Added:
   trunk/tools/quickbook/test/doc-info-2.gold   (contents, props changed)
   trunk/tools/quickbook/test/doc-info-2.quickbook   (contents, props changed)
Text files modified: 
   trunk/tools/quickbook/detail/actions.cpp        |    18 ++++++++++++------                      
   trunk/tools/quickbook/detail/actions_class.cpp  |     2 +-                                      
   trunk/tools/quickbook/detail/actions_class.hpp  |     2 +-                                      
   trunk/tools/quickbook/doc/quickbook.qbk         |     1 +                                       
   trunk/tools/quickbook/doc_info.hpp              |     5 +++--                                   
   trunk/tools/quickbook/test/Jamfile.v2           |     1 +                                       
   trunk/tools/quickbook/test/doc-info-1.quickbook |     2 ++                                      
   7 files changed, 21 insertions(+), 10 deletions(-)
Modified: trunk/tools/quickbook/detail/actions.cpp
==============================================================================
--- trunk/tools/quickbook/detail/actions.cpp	(original)
+++ trunk/tools/quickbook/detail/actions.cpp	2010-06-06 03:23:44 EDT (Sun, 06 Jun 2010)
@@ -1580,15 +1580,21 @@
             }
         }
 
-        if (!actions.doc_category.empty())
+        if (!actions.doc_categories.empty())
         {
             if (actions.doc_type == "library")
             {
-                out << "    <" << actions.doc_type << "category name=\"category:"
-                    << actions.doc_category
-                    << "\"></" << actions.doc_type << "category>\n"
-                    << "\n"
-                ;
+                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:"
+                        << *it
+                        << "\"></" << actions.doc_type << "category>\n"
+                        << "\n"
+                    ;
+                }
             }
             else
             {
Modified: trunk/tools/quickbook/detail/actions_class.cpp
==============================================================================
--- trunk/tools/quickbook/detail/actions_class.cpp	(original)
+++ trunk/tools/quickbook/detail/actions_class.cpp	2010-06-06 03:23:44 EDT (Sun, 06 Jun 2010)
@@ -26,7 +26,7 @@
         , doc_dirname()
         , doc_copyrights()
         , doc_purpose()
-        , doc_category()
+        , doc_categories()
         , doc_authors()
         , doc_license()
         , doc_last_revision()
Modified: trunk/tools/quickbook/detail/actions_class.hpp
==============================================================================
--- trunk/tools/quickbook/detail/actions_class.hpp	(original)
+++ trunk/tools/quickbook/detail/actions_class.hpp	2010-06-06 03:23:44 EDT (Sun, 06 Jun 2010)
@@ -40,7 +40,7 @@
         std::string             doc_dirname;
         copyright_list          doc_copyrights;
         std::string             doc_purpose;
-        std::string             doc_category;
+        string_list             doc_categories;
         author_list             doc_authors;
         std::string             doc_license;
         std::string             doc_last_revision;
Modified: trunk/tools/quickbook/doc/quickbook.qbk
==============================================================================
--- trunk/tools/quickbook/doc/quickbook.qbk	(original)
+++ trunk/tools/quickbook/doc/quickbook.qbk	2010-06-06 03:23:44 EDT (Sun, 06 Jun 2010)
@@ -196,6 +196,7 @@
 
 * Generate more valid boostbook (still invalid in a few places).
 * Warn about invalid doc_info members.
+* Support multiple categories in library doc_info.
 
 [endsect]
 
Modified: trunk/tools/quickbook/doc_info.hpp
==============================================================================
--- trunk/tools/quickbook/doc_info.hpp	(original)
+++ trunk/tools/quickbook/doc_info.hpp	2010-06-06 03:23:44 EDT (Sun, 06 Jun 2010)
@@ -117,7 +117,7 @@
 
                 doc_category =
                         "category" >> hard_space
-                    >> (*(anychar_p - ']'))         [assign_a(actions.doc_category)]
+                    >> (*(anychar_p - ']'))         [push_back_a(actions.doc_categories)]
                     ;
 
                 doc_author =
@@ -179,8 +179,9 @@
             bool unused;
             std::pair<std::string, std::string> name;
             std::pair<std::vector<std::string>, std::string> copyright;
+            std::string category;
             rule<Scanner>   doc_info, doc_title, doc_version, doc_id, doc_dirname,
-                            doc_copyright, doc_purpose,doc_category, doc_authors,
+                            doc_copyright, doc_purpose, doc_category, doc_authors,
                             doc_author, comment, space, hard_space, doc_license,
                             doc_last_revision, doc_source_mode, phrase, quickbook_version;
             phrase_grammar<Actions> common;
Modified: trunk/tools/quickbook/test/Jamfile.v2
==============================================================================
--- trunk/tools/quickbook/test/Jamfile.v2	(original)
+++ trunk/tools/quickbook/test/Jamfile.v2	2010-06-06 03:23:44 EDT (Sun, 06 Jun 2010)
@@ -35,6 +35,7 @@
     [ quickbook-test list_test ]
     [ quickbook-test cond_phrase ]
     [ quickbook-test doc-info-1 ]
+    [ quickbook-test doc-info-2 ]
     [ quickbook-test callouts ]
     [ quickbook-test simple_markup ]
     [ quickbook-test blocks ]
Modified: trunk/tools/quickbook/test/doc-info-1.quickbook
==============================================================================
--- trunk/tools/quickbook/test/doc-info-1.quickbook	(original)
+++ trunk/tools/quickbook/test/doc-info-1.quickbook	2010-06-06 03:23:44 EDT (Sun, 06 Jun 2010)
@@ -2,6 +2,8 @@
 [quickbook 1.5]
 [source-mode teletype]
 [purpose Inline code test: `1 + 2`]
+[category tests]
+[category irrelevance]
 ]
 
 The body is largely irrelevant.
\ No newline at end of file
Added: trunk/tools/quickbook/test/doc-info-2.gold
==============================================================================
--- (empty file)
+++ trunk/tools/quickbook/test/doc-info-2.gold	2010-06-06 03:23:44 EDT (Sun, 06 Jun 2010)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
+<library id="document_information_1" name="Document Information 1" dirname="document_information_1"
+last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude">
+  <libraryinfo>
+    <librarypurpose>
+      Inline code test: <code>1 + 2</code>
+    </librarypurpose>
+    <librarycategory name="category:tests"></librarycategory> <librarycategory name="category:irrelevance"></librarycategory>
+  </libraryinfo>
+  <title>Document Information 1</title>
+  <para>
+    The body is largely irrelevant.
+  </para>
+</library>
Added: trunk/tools/quickbook/test/doc-info-2.quickbook
==============================================================================
--- (empty file)
+++ trunk/tools/quickbook/test/doc-info-2.quickbook	2010-06-06 03:23:44 EDT (Sun, 06 Jun 2010)
@@ -0,0 +1,9 @@
+[library Document Information 1
+[quickbook 1.5]
+[source-mode teletype]
+[purpose Inline code test: `1 + 2`]
+[category tests]
+[category irrelevance]
+]
+
+The body is largely irrelevant.
\ No newline at end of file