Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64979 - in branches/release/tools/quickbook: . detail doc test
From: dnljms_at_[hidden]
Date: 2010-08-24 03:52:25


Author: danieljames
Date: 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
New Revision: 64979
URL: http://svn.boost.org/trac/boost/changeset/64979

Log:
Merge quickbook.

 - Explicitly use filesystem v2.
 - Fix command line macros.
 - Allow headings to have ids (quickbook 1.6)
 - Trim space from the start of titles, after ids.
 - Don't put nested lists inside inside boostbook paragraphs.
 - Improved code block parser.
 - Small improvements to the template implementation.
 - Merge multiple list items in variable list entries.
 - Nested code snippets.
 - Bump version number for 1.5.3.

Added:
   branches/release/tools/quickbook/test/code-block.gold
      - copied unchanged from r64978, /trunk/tools/quickbook/test/code-block.gold
   branches/release/tools/quickbook/test/code-block.quickbook
      - copied unchanged from r64978, /trunk/tools/quickbook/test/code-block.quickbook
   branches/release/tools/quickbook/test/command_line_macro.gold
      - copied unchanged from r64978, /trunk/tools/quickbook/test/command_line_macro.gold
   branches/release/tools/quickbook/test/command_line_macro.quickbook
      - copied unchanged from r64978, /trunk/tools/quickbook/test/command_line_macro.quickbook
   branches/release/tools/quickbook/test/heading_1_6.gold
      - copied unchanged from r64978, /trunk/tools/quickbook/test/heading_1_6.gold
   branches/release/tools/quickbook/test/heading_1_6.quickbook
      - copied unchanged from r64978, /trunk/tools/quickbook/test/heading_1_6.quickbook
   branches/release/tools/quickbook/test/variablelist.gold
      - copied unchanged from r64978, /trunk/tools/quickbook/test/variablelist.gold
   branches/release/tools/quickbook/test/variablelist.quickbook
      - copied unchanged from r64978, /trunk/tools/quickbook/test/variablelist.quickbook
Properties modified:
   branches/release/tools/quickbook/ (props changed)
Text files modified:
   branches/release/tools/quickbook/block.hpp | 69 ++++--
   branches/release/tools/quickbook/code_snippet.hpp | 103 ++++++----
   branches/release/tools/quickbook/detail/actions.cpp | 389 ++++++++++++++++++++++++---------------
   branches/release/tools/quickbook/detail/actions.hpp | 34 +++
   branches/release/tools/quickbook/detail/actions_class.cpp | 15
   branches/release/tools/quickbook/detail/actions_class.hpp | 4
   branches/release/tools/quickbook/detail/input_path.cpp | 4
   branches/release/tools/quickbook/detail/quickbook.cpp | 8
   branches/release/tools/quickbook/detail/template_stack.cpp | 8
   branches/release/tools/quickbook/detail/template_stack.hpp | 34 ++
   branches/release/tools/quickbook/doc/quickbook.qbk | 14 +
   branches/release/tools/quickbook/phrase.hpp | 36 +-
   branches/release/tools/quickbook/test/Jamfile.v2 | 4
   branches/release/tools/quickbook/test/callouts.cpp | 13 +
   branches/release/tools/quickbook/test/callouts.gold | 108 +++++++---
   branches/release/tools/quickbook/test/callouts.quickbook | 5
   branches/release/tools/quickbook/test/heading.gold | 14 +
   branches/release/tools/quickbook/test/heading.quickbook | 10
   branches/release/tools/quickbook/test/include_1_5.gold | 4
   branches/release/tools/quickbook/test/include_1_6-2.gold | 4
   branches/release/tools/quickbook/test/include_1_6.gold | 4
   branches/release/tools/quickbook/test/list_test.gold | 236 ++++++++++++------------
   branches/release/tools/quickbook/test/quickbook-manual.gold | 259 +++++++++++++------------
   branches/release/tools/quickbook/test/quickbook-testing.jam | 5
   branches/release/tools/quickbook/test/section_1_4.gold | 8
   branches/release/tools/quickbook/test/section_1_5.gold | 6
   branches/release/tools/quickbook/test/table_1_5.gold | 2
   27 files changed, 852 insertions(+), 548 deletions(-)

Modified: branches/release/tools/quickbook/block.hpp
==============================================================================
--- branches/release/tools/quickbook/block.hpp (original)
+++ branches/release/tools/quickbook/block.hpp 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
@@ -24,11 +24,11 @@
 {
     using namespace boost::spirit::classic;
 
- template <typename Actions, bool skip_initial_spaces = false>
+ template <typename Actions>
     struct block_grammar : grammar<block_grammar<Actions> >
     {
- block_grammar(Actions& actions_)
- : actions(actions_) {}
+ block_grammar(Actions& actions_, bool skip_initial_spaces = false)
+ : actions(actions_), skip_initial_spaces(skip_initial_spaces) { }
 
         template <typename Scanner>
         struct definition
@@ -40,10 +40,10 @@
                 using detail::var;
                 Actions& actions = self.actions;
 
- if (skip_initial_spaces)
+ if (self.skip_initial_spaces)
                 {
                     start_ =
- *(space_p | comment) >> blocks >> blank
+ *(blank_p | comment) >> blocks >> blank
                         ;
                 }
                 else
@@ -58,10 +58,9 @@
                     | code
                     | list [actions.list]
                     | hr [actions.hr]
- | comment >> +eol
+ | +eol
                     | paragraph [actions.inside_paragraph]
                                                         [actions.write_paragraphs]
- | eol
                     )
                     ;
 
@@ -146,10 +145,20 @@
                         ]
                         ;
 
+ element_id_1_6 =
+ if_p(qbk_since(106u)) [
+ element_id
+ ]
+ .else_p [
+ eps_p [assign_a(actions.element_id)]
+ ]
+ ;
+
                 begin_section =
                        "section"
>> hard_space
>> element_id
+ >> space
>> phrase [actions.begin_section]
                     ;
 
@@ -161,13 +170,13 @@
                     h1 | h2 | h3 | h4 | h5 | h6 | h
                     ;
 
- h = "heading" >> hard_space >> phrase [actions.h];
- h1 = "h1" >> hard_space >> phrase [actions.h1];
- h2 = "h2" >> hard_space >> phrase [actions.h2];
- h3 = "h3" >> hard_space >> phrase [actions.h3];
- h4 = "h4" >> hard_space >> phrase [actions.h4];
- h5 = "h5" >> hard_space >> phrase [actions.h5];
- h6 = "h6" >> hard_space >> phrase [actions.h6];
+ h = "heading" >> hard_space >> element_id_1_6 >> space >> phrase [actions.h];
+ h1 = "h1" >> hard_space >> element_id_1_6 >> space >> phrase [actions.h1];
+ h2 = "h2" >> hard_space >> element_id_1_6 >> space >> phrase [actions.h2];
+ h3 = "h3" >> hard_space >> element_id_1_6 >> space >> phrase [actions.h3];
+ h4 = "h4" >> hard_space >> element_id_1_6 >> space >> phrase [actions.h4];
+ h5 = "h5" >> hard_space >> element_id_1_6 >> space >> phrase [actions.h5];
+ h6 = "h6" >> hard_space >> element_id_1_6 >> space >> phrase [actions.h6];
 
                 static const bool true_ = true;
                 static const bool false_ = false;
@@ -244,7 +253,10 @@
                             )
>> space >> ']'
                     )
- >> template_body [actions.template_body]
+ >> ( eps_p(*blank_p >> eol_p) [assign_a(actions.template_block, true_)]
+ | eps_p [assign_a(actions.template_block, false_)]
+ )
+ >> template_body [actions.template_body]
                     ;
 
                 template_body =
@@ -268,8 +280,10 @@
>>
                     (
                         (
- varlistterm
- >> +varlistitem
+ varlistterm [actions.start_varlistitem]
+ >> ( +varlistitem
+ | eps_p [actions.error]
+ ) [actions.end_varlistitem]
>> ch_p(']') [actions.end_varlistentry]
>> space
                         )
@@ -293,12 +307,12 @@
 
                 varlistitem =
                     space
- >> ch_p('[') [actions.start_varlistitem]
+ >> ch_p('[')
>>
                     (
                         (
                             inside_paragraph
- >> ch_p(']') [actions.end_varlistitem]
+ >> ch_p(']')
>> space
                         )
                         | eps_p [actions.error]
@@ -374,14 +388,17 @@
                 code =
                     (
                         code_line
- >> *(*eol >> code_line)
+ >> *(*blank_line >> code_line)
                     ) [actions.code]
- >> +eol
+ >> *eol
                     ;
 
                 code_line =
- ((ch_p(' ') | '\t'))
- >> *(anychar_p - eol) >> eol
+ blank_p >> *(anychar_p - eol_p) >> eol_p
+ ;
+
+ blank_line =
+ *blank_p >> eol_p
                     ;
 
                 list =
@@ -436,7 +453,7 @@
 
             bool no_eols;
 
- rule<Scanner> start_, blocks, block_markup, code, code_line,
+ rule<Scanner> start_, blocks, block_markup, code, code_line, blank_line,
                             paragraph, space, blank, comment, headings, h, h1, h2,
                             h3, h4, h5, h6, hr, blurb, blockquote, admonition,
                             phrase, list, phrase_end, ordered_list, def_macro,
@@ -446,7 +463,8 @@
                             xinclude, include, hard_space, eol, paragraph_end,
                             template_, template_id, template_formal_arg,
                             template_body, identifier, dummy_block, import,
- inside_paragraph, element_id, element_id_1_5;
+ inside_paragraph,
+ element_id, element_id_1_5, element_id_1_6;
 
             symbols<> paragraph_end_markups;
 
@@ -457,6 +475,7 @@
         };
 
         Actions& actions;
+ bool const skip_initial_spaces;
     };
 }
 

Modified: branches/release/tools/quickbook/code_snippet.hpp
==============================================================================
--- branches/release/tools/quickbook/code_snippet.hpp (original)
+++ branches/release/tools/quickbook/code_snippet.hpp 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
@@ -22,20 +22,44 @@
         code_snippet_actions(std::vector<template_symbol>& storage,
                                  std::string const& doc_id,
                                  char const* source_type)
- : storage(storage)
+ : callout_id(0)
+ , storage(storage)
             , doc_id(doc_id)
             , source_type(source_type)
         {}
 
+ void pass_thru_char(char);
         void pass_thru(iterator first, iterator last);
         void escaped_comment(iterator first, iterator last);
- void compile(iterator first, iterator last);
+ void start_snippet(iterator first, iterator last);
+ void end_snippet(iterator first, iterator last);
         void callout(iterator first, iterator last);
+
+ void append_code();
+ void close_code();
 
+ struct snippet_data
+ {
+ snippet_data(std::string const& id, int callout_base_id)
+ : id(id)
+ , callout_base_id(callout_base_id)
+ , content()
+ , start_code(false)
+ , end_code(false)
+ {}
+
+ std::string id;
+ int callout_base_id;
+ std::string content;
+ bool start_code;
+ bool end_code;
+ std::vector<template_body> callouts;
+ };
+
+ int callout_id;
+ std::stack<snippet_data> snippet_stack;
         std::string code;
- std::string snippet;
         std::string id;
- std::vector<std::string> callouts;
         std::vector<template_symbol>& storage;
         std::string const doc_id;
         char const* const source_type;
@@ -57,30 +81,30 @@
             
             definition(python_code_snippet_grammar const& self)
             {
+
                 actions_type& actions = self.actions;
             
- start_ =
- +(
- snippet [boost::bind(&actions_type::compile, &actions, _1, _2)]
- | anychar_p
- )
- ;
+ start_ = *code_elements;
 
                 identifier =
                     (alpha_p | '_') >> *(alnum_p | '_')
                     ;
 
- snippet =
+ code_elements =
+ start_snippet [boost::bind(&actions_type::start_snippet, &actions, _1, _2)]
+ | end_snippet [boost::bind(&actions_type::end_snippet, &actions, _1, _2)]
+ | escaped_comment
+ | ignore
+ | anychar_p [boost::bind(&actions_type::pass_thru_char, &actions, _1)]
+ ;
+
+ start_snippet =
                     "#[" >> *space_p
>> identifier [assign_a(actions.id)]
- >> (*(code_elements - "#]"))
- >> "#]"
                     ;
 
- code_elements =
- escaped_comment
- | ignore
- | (anychar_p - "#]") [boost::bind(&actions_type::pass_thru, &actions, _1, _2)]
+ end_snippet =
+ str_p("#]")
                     ;
 
                 ignore =
@@ -106,8 +130,8 @@
             }
 
             rule<Scanner>
- start_, snippet, identifier, code_elements, escaped_comment,
- ignore;
+ start_, identifier, code_elements, start_snippet, end_snippet,
+ escaped_comment, ignore;
 
             rule<Scanner> const&
             start() const { return start_; }
@@ -132,46 +156,45 @@
             {
                 actions_type& actions = self.actions;
             
- start_ =
- +(
- snippet [boost::bind(&actions_type::compile, &actions, _1, _2)]
- | anychar_p
- )
- ;
+ start_ = *code_elements;
 
                 identifier =
                     (alpha_p | '_') >> *(alnum_p | '_')
                     ;
 
- snippet =
+ code_elements =
+ start_snippet [boost::bind(&actions_type::start_snippet, &actions, _1, _2)]
+ | end_snippet [boost::bind(&actions_type::end_snippet, &actions, _1, _2)]
+ | escaped_comment
+ | ignore
+ | line_callout
+ | inline_callout
+ | anychar_p [boost::bind(&actions_type::pass_thru_char, &actions, _1)]
+ ;
+
+ start_snippet =
                         "//[" >> *space_p
- >> identifier [assign_a(actions.id)]
- >> (*(code_elements - "//]"))
- >> "//]"
+ >> identifier [assign_a(actions.id)]
                     |
                         "/*[" >> *space_p
- >> identifier [assign_a(actions.id)]
+ >> identifier [assign_a(actions.id)]
>> *space_p >> "*/"
- >> (*(code_elements - "/*]*"))
- >> "/*]*/"
                     ;
 
- code_elements =
- escaped_comment
- | ignore
- | line_callout
- | inline_callout
- | (anychar_p - "//]" - "/*]*/") [boost::bind(&actions_type::pass_thru, &actions, _1, _2)]
+ end_snippet =
+ str_p("//]") | "/*]*/"
                     ;
 
                 inline_callout =
                     "/*<"
+ >> *space_p
>> (*(anychar_p - ">*/")) [boost::bind(&actions_type::callout, &actions, _1, _2)]
>> ">*/"
                     ;
 
                 line_callout =
                     "/*<<"
+ >> *space_p
>> (*(anychar_p - ">>*/")) [boost::bind(&actions_type::callout, &actions, _1, _2)]
>> ">>*/"
>> *space_p
@@ -200,8 +223,8 @@
             }
 
             rule<Scanner>
- start_, snippet, identifier, code_elements, escaped_comment,
- inline_callout, line_callout, ignore;
+ start_, identifier, code_elements, start_snippet, end_snippet,
+ escaped_comment, inline_callout, line_callout, ignore;
 
             rule<Scanner> const&
             start() const { return start_; }

Modified: branches/release/tools/quickbook/detail/actions.cpp
==============================================================================
--- branches/release/tools/quickbook/detail/actions.cpp (original)
+++ branches/release/tools/quickbook/detail/actions.cpp 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
@@ -10,9 +10,10 @@
 =============================================================================*/
 #include <numeric>
 #include <functional>
+#include <algorithm>
 #include <boost/bind.hpp>
-#include <boost/filesystem/convenience.hpp>
-#include <boost/filesystem/fstream.hpp>
+#include <boost/filesystem/v2/convenience.hpp>
+#include <boost/filesystem/v2/fstream.hpp>
 #include <boost/lexical_cast.hpp>
 #include <boost/algorithm/string/join.hpp>
 #include "./quickbook.hpp"
@@ -105,8 +106,9 @@
         }
         else // version 1.3 and above
         {
- std::string id = qbk_version_n >= 106 ?
- detail::make_identifier(first, last) :
+ std::string id =
+ !element_id.empty() ? element_id :
+ qbk_version_n >= 106 ? detail::make_identifier(first, last) :
                 detail::make_identifier(str.begin(), str.end());
 
             std::string anchor =
@@ -132,8 +134,9 @@
         std::string str;
         phrase.swap(str);
 
- std::string id = qbk_version_n >= 106 ?
- detail::make_identifier(first, last) :
+ std::string id =
+ !element_id.empty() ? element_id :
+ qbk_version_n >= 106 ? detail::make_identifier(first, last) :
             detail::make_identifier(str.begin(), str.end());
 
         std::string anchor =
@@ -202,7 +205,7 @@
             list_marks.pop();
             out << std::string((mark == '#') ? "\n</orderedlist>" : "\n</itemizedlist>");
             if (list_marks.size() >= 1)
- out << list_item_post;
+ out << "</listitem>";
         }
 
         list_indent = -1; // reset
@@ -242,12 +245,12 @@
             {
                 // Make this new list a child of the previous list.
                 // The previous listelem has already ended so we erase
- // list_item_post to accomodate this sub-list. We'll close
+ // "</listitem>" to accomodate this sub-list. We'll close
                 // the listelem later.
 
                 std::string str;
                 out.swap(str);
- std::string::size_type pos = str.rfind(list_item_post);
+ std::string::size_type pos = str.rfind("</listitem>");
                 BOOST_ASSERT(pos <= str.size());
                 str.erase(str.begin()+pos, str.end());
                 out << str;
@@ -266,7 +269,7 @@
                 list_marks.pop();
                 out << std::string((mark == '#') ? "\n</orderedlist>" : "\n</itemizedlist>");
                 if (list_marks.size() >= 1)
- out << list_item_post;
+ out << "</listitem>";
             }
         }
 
@@ -601,7 +604,8 @@
     {
         if (!actions.templates.add(
             template_symbol(actions.template_identifier, actions.template_info,
- std::string(first, last), first.get_position())))
+ std::string(first, last), first.get_position(),
+ actions.template_block, &actions.templates.top_scope())))
         {
             boost::spirit::classic::file_position const pos = first.get_position();
             detail::outerr(pos.file,pos.line)
@@ -615,48 +619,53 @@
 
     namespace
     {
- std::string::size_type find_bracket_end(std::string const& str, std::string::size_type pos)
+ iterator find_bracket_end(iterator begin, iterator const& end)
         {
             unsigned int depth = 1;
 
             while(depth > 0) {
- pos = str.find_first_of("[]\\", pos);
- if(pos == std::string::npos) return pos;
+ char const* search_chars = "[]\\";
+ begin = std::find_first_of(begin, end, search_chars, search_chars + 3);
+ if(begin == end) return begin;
 
- if(str[pos] == '\\')
+ if(*begin == '\\')
                 {
- pos += 2;
+ if(++begin == end) return begin;
+ ++begin;
                 }
                 else
                 {
- depth += (str[pos] == '[') ? 1 : -1;
- ++pos;
+ depth += (*begin == '[') ? 1 : -1;
+ ++begin;
                 }
             }
 
- return pos;
+ return begin;
         }
 
- std::string::size_type find_first_seperator(std::string const& str)
+ iterator find_first_seperator(iterator const& begin, iterator const& end)
         {
             if(qbk_version_n < 105) {
- return str.find_first_of(" \t\r\n");
+ char const* whitespace = " \t\r\n";
+ return std::find_first_of(begin, end, whitespace, whitespace + 4);
             }
             else {
- std::string::size_type pos = 0;
+ iterator pos = begin;
 
                 while(true)
                 {
- pos = str.find_first_of(" \t\r\n\\[", pos);
- if(pos == std::string::npos) return pos;
+ char const* search_chars = " \t\r\n\\[";
+ pos = std::find_first_of(pos, end, search_chars, search_chars + 6);
+ if(pos == end) return pos;
 
- switch(str[pos])
+ switch(*pos)
                     {
                     case '[':
- pos = find_bracket_end(str, pos + 1);
+ pos = find_bracket_end(++pos, end);
                         break;
                     case '\\':
- pos += 2;
+ if(++pos == end) return pos;
+ ++pos;
                         break;
                     default:
                         return pos;
@@ -666,7 +675,7 @@
         }
     
         bool break_arguments(
- std::vector<std::string>& args
+ std::vector<template_body>& args
           , std::vector<std::string> const& params
           , boost::spirit::classic::file_position const& pos
         )
@@ -680,23 +689,29 @@
 
             if (qbk_version_n < 105 || args.size() == 1)
             {
- while (args.size() < params.size() )
+
+ while (args.size() < params.size())
                 {
                     // Try to break the last argument at the first space found
                     // and push it into the back of args. Do this
                     // recursively until we have all the expected number of
                     // arguments, or if there are no more spaces left.
 
- std::string& str = args.back();
- std::string::size_type l_pos = find_first_seperator(str);
- if (l_pos == std::string::npos)
+ template_body& body = args.back();
+ iterator begin(body.content.begin(), body.content.end(), body.position.file);
+ iterator end(body.content.end(), body.content.end());
+
+ iterator l_pos = find_first_seperator(begin, end);
+ if (l_pos == end)
                         break;
- std::string first(str.begin(), str.begin()+l_pos);
- std::string::size_type r_pos = str.find_first_not_of(" \t\r\n", l_pos);
- if (r_pos == std::string::npos)
+ char const* whitespace = " \t\r\n";
+ char const* whitespace_end = whitespace + 4;
+ iterator r_pos = l_pos;
+ while(r_pos != end && std::find(whitespace, whitespace_end, *r_pos) != whitespace_end) ++r_pos;
+ if (r_pos == end)
                         break;
- std::string second(str.begin()+r_pos, str.end());
- str = first;
+ template_body second(std::string(r_pos, end), begin.get_position(), false);
+ body.content = std::string(begin, l_pos);
                     args.push_back(second);
                 }
             }
@@ -717,14 +732,14 @@
 
         std::pair<bool, std::vector<std::string>::const_iterator>
         get_arguments(
- std::vector<std::string>& args
+ std::vector<template_body>& args
           , std::vector<std::string> const& params
           , template_scope const& scope
           , boost::spirit::classic::file_position const& pos
           , quickbook::actions& actions
         )
         {
- std::vector<std::string>::const_iterator arg = args.begin();
+ std::vector<template_body>::const_iterator arg = args.begin();
             std::vector<std::string>::const_iterator tpl = params.begin();
             std::vector<std::string> empty_params;
 
@@ -733,7 +748,8 @@
             while (arg != args.end())
             {
                 if (!actions.templates.add(
- template_symbol(*tpl, empty_params, *arg, pos, &scope)))
+ template_symbol(*tpl, empty_params, arg->content,
+ arg->position, arg->is_block, &scope)))
                 {
                     detail::outerr(pos.file,pos.line)
                         << "Duplicate Symbol Found" << std::endl;
@@ -744,12 +760,11 @@
             }
             return std::make_pair(true, tpl);
         }
-
+
         bool parse_template(
- std::string body
+ template_body const& body
+ , bool escape
           , std::string& result
- , bool& is_block
- , boost::spirit::classic::file_position const& template_pos
           , quickbook::actions& actions
         )
         {
@@ -757,53 +772,43 @@
             // a phrase? We apply a simple heuristic: if the body starts with
             // a newline, then we regard it as a block, otherwise, we parse
             // it as a phrase.
+ //
+ // Note: this is now done in the grammar.
 
- body.reserve(body.size() + 2);
-
- std::string::const_iterator iter = body.begin();
- while (iter != body.end() && ((*iter == ' ') || (*iter == '\t')))
- ++iter; // skip spaces and tabs
- is_block = (iter != body.end()) && ((*iter == '\r') || (*iter == '\n'));
- bool r = false;
-
- if (actions.template_escape)
+ if (escape)
             {
                 // escape the body of the template
                 // we just copy out the literal body
- result = body;
- r = true;
+ result = body.content;
+ return true;
             }
- else if (!is_block)
+ else if (!body.is_block)
             {
                 simple_phrase_grammar<quickbook::actions> phrase_p(actions);
 
                 // do a phrase level parse
- iterator first(body.begin(), body.end(), actions.filename.file_string().c_str());
- first.set_position(template_pos);
- iterator last(body.end(), body.end());
- r = boost::spirit::classic::parse(first, last, phrase_p).full;
+ iterator first(body.content.begin(), body.content.end(), body.position);
+ iterator last(body.content.end(), body.content.end());
+ bool r = boost::spirit::classic::parse(first, last, phrase_p).full;
                 actions.phrase.swap(result);
+ return r;
             }
             else
             {
- block_grammar<quickbook::actions, true> block_p(actions);
+ block_grammar<quickbook::actions> block_p(actions, true);
 
                 // do a block level parse
                 // ensure that we have enough trailing newlines to eliminate
                 // the need to check for end of file in the grammar.
- body.push_back('\n');
- body.push_back('\n');
- while (iter != body.end() && ((*iter == '\r') || (*iter == '\n')))
- ++iter; // skip initial newlines
- iterator first(iter, body.end(), actions.filename.file_string().c_str());
- first.set_position(template_pos);
- iterator last(body.end(), body.end());
- r = boost::spirit::classic::parse(first, last, block_p).full;
+
+ std::string content = body.content + "\n\n";
+ iterator first(content.begin(), content.end(), body.position);
+ iterator last(content.end(), content.end());
+ bool r = boost::spirit::classic::parse(first, last, block_p).full;
                 actions.inside_paragraph();
                 actions.out.swap(result);
+ return r;
             }
-
- return r;
         }
     }
 
@@ -812,13 +817,22 @@
         int callout_id = 0;
     }
 
+ void template_arg_action::operator()(iterator first, iterator last) const
+ {
+ actions.template_args.push_back(
+ template_body(
+ std::string(first, last),
+ first.get_position(),
+ actions.template_block));
+ }
+
     void do_template_action::operator()(iterator first, iterator) const
     {
         // Get the arguments and clear values stored in action.
 
- std::vector<std::string> args;
+ std::vector<template_body> args;
         std::string identifier;
- std::swap(args, actions.template_info);
+ std::swap(args, actions.template_args);
         std::swap(identifier, actions.template_identifier);
         boost::spirit::classic::file_position const pos = first.get_position();
 
@@ -843,7 +857,6 @@
         BOOST_ASSERT(symbol);
             
         std::string result;
- bool is_block;
         actions.push(); // scope the actions' states
         {
             // Store the current section level so that we can ensure that
@@ -884,13 +897,12 @@
                     args.clear();
                 }
 
- BOOST_ASSERT(symbol->params.size() % 2 == 0);
- unsigned int size = symbol->params.size() / 2;
+ unsigned int size = symbol->params.size();
 
                 for(unsigned int i = 0; i < size; ++i)
                 {
                     std::string callout_id = actions.doc_id +
- boost::lexical_cast<std::string>(detail::callout_id++);
+ boost::lexical_cast<std::string>(detail::callout_id + i);
 
                     std::string code;
                     code += "'''";
@@ -898,15 +910,7 @@
                     code += "linkends=\"" + callout_id + "\" />";
                     code += "'''";
 
- args.push_back(code);
-
- code.clear();
- code += "'''";
- code += "<callout arearefs=\"" + callout_id + "co\" ";
- code += "id=\"" + callout_id + "\">";
- code += "'''";
-
- args.push_back(code);
+ args.push_back(template_body(code, first.get_position(), false));
                 }
             }
 
@@ -928,14 +932,16 @@
             ///////////////////////////////////
             // parse the template body:
 
- if (!parse_template(symbol->body, result, is_block, symbol->position, actions))
+ if (!parse_template(symbol->body, actions.template_escape, result, actions))
             {
                 boost::spirit::classic::file_position const pos = first.get_position();
                 detail::outerr(pos.file,pos.line)
- << "Expanding template:" << symbol->identifier << std::endl
+ << "Expanding "
+ << (symbol->body.is_block ? "block" : "phrase")
+ << " template: " << symbol->identifier << std::endl
                     << std::endl
                     << "------------------begin------------------" << std::endl
- << symbol->body
+ << symbol->body.content
                     << "------------------end--------------------" << std::endl
                     << std::endl;
                 actions.pop(); // restore the actions' states
@@ -957,7 +963,37 @@
         }
 
         actions.pop(); // restore the actions' states
- if(is_block) {
+
+ if(symbol->callout && symbol->callouts.size() > 0)
+ {
+ result += "<calloutlist>";
+ BOOST_FOREACH(template_body const& c, symbol->callouts)
+ {
+ std::string callout_id = actions.doc_id +
+ boost::lexical_cast<std::string>(detail::callout_id++);
+
+ std::string callout_value;
+ actions.push();
+ bool r = parse_template(c, false, callout_value, actions);
+ actions.pop();
+
+ if(!r)
+ {
+ detail::outerr(c.position.file, c.position.line)
+ << "Expanding callout." << std::endl;
+ ++actions.error_count;
+ return;
+ }
+
+ result += "<callout arearefs=\"" + callout_id + "co\" ";
+ result += "id=\"" + callout_id + "\">";
+ result += callout_value;
+ result += "</callout>";
+ }
+ result += "</calloutlist>";
+ }
+
+ if(symbol->body.is_block) {
             actions.inside_paragraph();
             actions.temp_para << result; // print it!!!
         }
@@ -1009,13 +1045,13 @@
         actions.table_title.clear();
     }
 
- void start_varlistitem_action::operator()(char) const
+ void start_varlistitem_action::operator()() const
     {
         phrase << start_varlistitem_;
         phrase.push();
     }
 
- void end_varlistitem_action::operator()(char) const
+ void end_varlistitem_action::operator()() const
     {
         std::string str;
         temp_para.swap(str);
@@ -1240,85 +1276,143 @@
         out << "\" />\n";
     }
 
+ void code_snippet_actions::append_code()
+ {
+ if(snippet_stack.empty()) return;
+ snippet_data& snippet = snippet_stack.top();
+
+ if (!code.empty())
+ {
+ detail::unindent(code); // remove all indents
+
+ if(snippet.content.empty())
+ {
+ snippet.start_code = true;
+ }
+ else if(!snippet.end_code)
+ {
+ snippet.content += "\n\n";
+ snippet.content += source_type;
+ snippet.content += "```\n";
+ }
+
+ snippet.content += code;
+ snippet.end_code = true;
+
+ code.clear();
+ }
+ }
+
+ void code_snippet_actions::close_code()
+ {
+ if(snippet_stack.empty()) return;
+ snippet_data& snippet = snippet_stack.top();
+
+ if(snippet.end_code)
+ {
+ snippet.content += "```\n\n";
+ snippet.end_code = false;
+ }
+ }
+
     void code_snippet_actions::pass_thru(iterator first, iterator last)
     {
+ if(snippet_stack.empty()) return;
         code += *first;
     }
 
+ void code_snippet_actions::pass_thru_char(char c)
+ {
+ if(snippet_stack.empty()) return;
+ code += c;
+ }
+
     void code_snippet_actions::callout(iterator first, iterator last)
     {
- code += "``[[callout" + boost::lexical_cast<std::string>(callouts.size()) + "]]``";
+ if(snippet_stack.empty()) return;
+ code += "``[[callout" + boost::lexical_cast<std::string>(callout_id) + "]]``";
     
- callouts.push_back(std::string(first, last));
+ snippet_stack.top().callouts.push_back(
+ template_body(std::string(first, last), first.get_position(), true));
+ ++callout_id;
     }
 
     void code_snippet_actions::escaped_comment(iterator first, iterator last)
     {
- if (!code.empty())
- {
- detail::unindent(code); // remove all indents
- if (code.size() != 0)
- {
- snippet += "\n\n";
- snippet += source_type;
- snippet += "``\n" + code + "``\n\n";
- code.clear();
- }
- }
+ if(snippet_stack.empty()) return;
+ snippet_data& snippet = snippet_stack.top();
+ append_code();
+ close_code();
+
         std::string temp(first, last);
         detail::unindent(temp); // remove all indents
         if (temp.size() != 0)
         {
- snippet += "\n" + temp; // add a linebreak to allow block marskups
+ snippet.content += "\n" + temp; // add a linebreak to allow block markups
         }
     }
 
- void code_snippet_actions::compile(iterator first, iterator last)
+ void code_snippet_actions::start_snippet(iterator first, iterator last)
     {
+ append_code();
+ snippet_stack.push(snippet_data(id, callout_id));
+ id.clear();
+ }
+
+ void code_snippet_actions::end_snippet(iterator first, iterator last)
+ {
+ // TODO: Error?
+ if(snippet_stack.empty()) return;
+
+ append_code();
+
+ snippet_data snippet = snippet_stack.top();
+ snippet_stack.pop();
+
+ std::string body;
+ if(snippet.start_code) {
+ body += "\n\n";
+ body += source_type;
+ body += "```\n";
+ }
+ body += snippet.content;
+ if(snippet.end_code) {
+ body += "```\n\n";
+ }
+
         std::vector<std::string> params;
-
- if (!code.empty())
+ for (size_t i = 0; i < snippet.callouts.size(); ++i)
         {
- detail::unindent(code); // remove all indents
- if (code.size() != 0)
- {
- snippet += "\n\n";
- snippet += source_type;
- snippet += "```\n" + code + "```\n\n";
- }
-
- if(callouts.size() > 0)
- {
- std::vector<std::string> callout_items;
-
- snippet += "'''<calloutlist>'''";
- for (size_t i = 0; i < callouts.size(); ++i)
- {
- std::string callout_template = "[callout" + boost::lexical_cast<std::string>(i) + "]";
- std::string calloutitem_template = "[calloutitem" + boost::lexical_cast<std::string>(i) + "]";
-
- snippet += "[" + calloutitem_template + "]";
- snippet += "'''<para>'''";
- snippet += callouts[i];
- snippet += "\n";
- snippet += "'''</para>'''";
- snippet += "'''</callout>'''";
-
- params.push_back(callout_template);
- params.push_back(calloutitem_template);
- }
- snippet += "'''</calloutlist>'''";
- }
+ params.push_back("[callout" + boost::lexical_cast<std::string>(snippet.callout_base_id + i) + "]");
         }
-
- template_symbol symbol(id, params, snippet, first.get_position());
+
+ // TODO: Save position in start_snippet
+ template_symbol symbol(snippet.id, params, body, first.get_position(), true);
         symbol.callout = true;
+ symbol.callouts = snippet.callouts;
         storage.push_back(symbol);
 
- callouts.clear();
- code.clear();
- snippet.clear();
- id.clear();
+ // Merge the snippet into its parent
+
+ if(!snippet_stack.empty())
+ {
+ snippet_data& next = snippet_stack.top();
+ if(!snippet.content.empty()) {
+ if(!snippet.start_code) {
+ close_code();
+ }
+ else if(!next.end_code) {
+ next.content += "\n\n";
+ next.content += source_type;
+ next.content += "```\n";
+ }
+
+ next.content += snippet.content;
+ next.end_code = snippet.end_code;
+ }
+
+ next.callouts.insert(next.callouts.end(), snippet.callouts.begin(), snippet.callouts.end());
+ }
     }
 
     int load_snippets(
@@ -1391,12 +1485,13 @@
         actions.error_count +=
             load_snippets(path.string(), storage, ext, actions.doc_id);
 
- BOOST_FOREACH(template_symbol const& ts, storage)
+ BOOST_FOREACH(template_symbol& ts, storage)
         {
             std::string tname = ts.identifier;
+ ts.parent = &actions.templates.top_scope();
             if (!actions.templates.add(ts))
             {
- boost::spirit::classic::file_position const pos = ts.position;
+ boost::spirit::classic::file_position const pos = ts.body.position;
                 detail::outerr(pos.file, pos.line)
                     << "Template Redefinition: " << tname << std::endl;
                 ++actions.error_count;

Modified: branches/release/tools/quickbook/detail/actions.hpp
==============================================================================
--- branches/release/tools/quickbook/detail/actions.hpp (original)
+++ branches/release/tools/quickbook/detail/actions.hpp 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
@@ -17,7 +17,7 @@
 #include <stack>
 #include <algorithm>
 #include <boost/spirit/include/classic_iterator.hpp>
-#include <boost/filesystem/operations.hpp>
+#include <boost/filesystem/v2/operations.hpp>
 #include <boost/foreach.hpp>
 #include <boost/tuple/tuple.hpp>
 #include "../syntax_highlight.hpp"
@@ -116,6 +116,7 @@
         header_action(
             collector& out,
             collector& phrase,
+ std::string const& element_id,
             std::string const& library_id,
             std::string const& section_id,
             std::string const& qualified_section_id,
@@ -123,6 +124,7 @@
             std::string const& post)
         : out(out)
         , phrase(phrase)
+ , element_id(element_id)
         , library_id(library_id)
         , section_id(section_id)
         , qualified_section_id(qualified_section_id)
@@ -133,6 +135,7 @@
 
         collector& out;
         collector& phrase;
+ std::string const& element_id;
         std::string const& library_id;
         std::string const& section_id;
         std::string const& qualified_section_id;
@@ -147,12 +150,14 @@
         generic_header_action(
             collector& out,
             collector& phrase,
+ std::string const& element_id,
             std::string const& library_id,
             std::string const& section_id,
             std::string const& qualified_section_id,
             int const& section_level)
         : out(out)
         , phrase(phrase)
+ , element_id(element_id)
         , library_id(library_id)
         , section_id(section_id)
         , qualified_section_id(qualified_section_id)
@@ -162,6 +167,7 @@
 
         collector& out;
         collector& phrase;
+ std::string const& element_id;
         std::string const& library_id;
         std::string const& section_id;
         std::string const& qualified_section_id;
@@ -563,7 +569,12 @@
         start_varlistitem_action(collector& phrase)
         : phrase(phrase) {}
 
- void operator()(char) const;
+ void operator()() const;
+
+ template <typename T1>
+ void operator()(T1 const&) const { return (*this)(); }
+ template <typename T1, typename T2>
+ void operator()(T1 const&, T2 const&) const { return (*this)(); }
 
         collector& phrase;
     };
@@ -573,7 +584,12 @@
         end_varlistitem_action(collector& phrase, collector& temp_para)
         : phrase(phrase), temp_para(temp_para) {}
 
- void operator()(char) const;
+ void operator()() const;
+
+ template <typename T1>
+ void operator()(T1 const&) const { return (*this)(); }
+ template <typename T1, typename T2>
+ void operator()(T1 const&, T2 const&) const { return (*this)(); }
 
         collector& phrase;
         collector& temp_para;
@@ -626,6 +642,18 @@
 
         quickbook::actions& actions;
     };
+
+ struct template_arg_action
+ {
+ // Handles a template argument
+
+ template_arg_action(quickbook::actions& actions)
+ : actions(actions) {}
+
+ void operator()(iterator first, iterator last) const;
+
+ quickbook::actions& actions;
+ };
 
     struct do_template_action
     {

Modified: branches/release/tools/quickbook/detail/actions_class.cpp
==============================================================================
--- branches/release/tools/quickbook/detail/actions_class.cpp (original)
+++ branches/release/tools/quickbook/detail/actions_class.cpp 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
@@ -81,13 +81,13 @@
         , inline_code(phrase, syntax_p)
         , inside_paragraph(temp_para, phrase, paragraph_pre, paragraph_post)
         , write_paragraphs(out, temp_para)
- , h(out, phrase, doc_id, section_id, qualified_section_id, section_level)
- , h1(out, phrase, doc_id, section_id, qualified_section_id, h1_pre, h1_post)
- , h2(out, phrase, doc_id, section_id, qualified_section_id, h2_pre, h2_post)
- , h3(out, phrase, doc_id, section_id, qualified_section_id, h3_pre, h3_post)
- , h4(out, phrase, doc_id, section_id, qualified_section_id, h4_pre, h4_post)
- , h5(out, phrase, doc_id, section_id, qualified_section_id, h5_pre, h5_post)
- , h6(out, phrase, doc_id, section_id, qualified_section_id, h6_pre, h6_post)
+ , h(out, phrase, element_id, doc_id, section_id, qualified_section_id, section_level)
+ , h1(out, phrase, element_id, doc_id, section_id, qualified_section_id, h1_pre, h1_post)
+ , h2(out, phrase, element_id, doc_id, section_id, qualified_section_id, h2_pre, h2_post)
+ , h3(out, phrase, element_id, doc_id, section_id, qualified_section_id, h3_pre, h3_post)
+ , h4(out, phrase, element_id, doc_id, section_id, qualified_section_id, h4_pre, h4_post)
+ , h5(out, phrase, element_id, doc_id, section_id, qualified_section_id, h5_pre, h5_post)
+ , h6(out, phrase, element_id, doc_id, section_id, qualified_section_id, h6_pre, h6_post)
         , hr(out, hr_)
         , blurb(out, temp_para, blurb_pre, blurb_post)
         , blockquote(out, temp_para, blockquote_pre, blockquote_post)
@@ -162,6 +162,7 @@
         , macro_definition(*this)
         , do_macro(phrase)
         , template_body(*this)
+ , template_arg(*this)
         , do_template(*this)
         , url_pre(phrase, url_pre_)
         , url_post(phrase, url_post_)

Modified: branches/release/tools/quickbook/detail/actions_class.hpp
==============================================================================
--- branches/release/tools/quickbook/detail/actions_class.hpp (original)
+++ branches/release/tools/quickbook/detail/actions_class.hpp 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
@@ -93,6 +93,9 @@
         string_list template_info;
         int template_depth;
         bool template_escape;
+ bool template_block;
+ std::vector<quickbook::template_body>
+ template_args;
         template_stack templates;
         int error_count;
         std::string image_fileref;
@@ -186,6 +189,7 @@
         macro_definition_action macro_definition;
         do_macro_action do_macro;
         template_body_action template_body;
+ template_arg_action template_arg;
         do_template_action do_template;
         link_action url_pre;
         markup_action url_post;

Modified: branches/release/tools/quickbook/detail/input_path.cpp
==============================================================================
--- branches/release/tools/quickbook/detail/input_path.cpp (original)
+++ branches/release/tools/quickbook/detail/input_path.cpp 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
@@ -30,7 +30,7 @@
 
 // Cygwin 1.5.x
 
-#include <boost/filesystem/config.hpp>
+#include <boost/filesystem/v2/config.hpp>
 #include <windows.h>
 #include <sys/cygwin.h>
 
@@ -61,7 +61,7 @@
 
 // Cygwin 1.7.x
     
-#include <boost/filesystem/config.hpp>
+#include <boost/filesystem/v2/config.hpp>
 #include <boost/scoped_array.hpp>
 #include <boost/program_options/errors.hpp>
 #include <windows.h>

Modified: branches/release/tools/quickbook/detail/quickbook.cpp
==============================================================================
--- branches/release/tools/quickbook/detail/quickbook.cpp (original)
+++ branches/release/tools/quickbook/detail/quickbook.cpp 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
@@ -16,8 +16,8 @@
 #include "./input_path.hpp"
 #include <boost/spirit/include/classic_iterator.hpp>
 #include <boost/program_options.hpp>
-#include <boost/filesystem/path.hpp>
-#include <boost/filesystem/operations.hpp>
+#include <boost/filesystem/v2/path.hpp>
+#include <boost/filesystem/v2/operations.hpp>
 #include <boost/ref.hpp>
 
 #include <stdexcept>
@@ -29,7 +29,7 @@
 #pragma warning(disable:4355)
 #endif
 
-#define QUICKBOOK_VERSION "Quickbook Version 1.5.2"
+#define QUICKBOOK_VERSION "Quickbook Version 1.5.3"
 
 namespace quickbook
 {
@@ -78,7 +78,7 @@
                     ;
 
                 macro_identifier =
- +(anychar_p - (space_p | ']'))
+ +(anychar_p - (space_p | ']' | '='))
                     ;
 
                 phrase =

Modified: branches/release/tools/quickbook/detail/template_stack.cpp
==============================================================================
--- branches/release/tools/quickbook/detail/template_stack.cpp (original)
+++ branches/release/tools/quickbook/detail/template_stack.cpp 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
@@ -52,16 +52,14 @@
     bool template_stack::add(template_symbol const& ts)
     {
         BOOST_ASSERT(!scopes.empty());
+ BOOST_ASSERT(ts.parent);
         
         if (this->find_top_scope(ts.identifier)) {
             return false;
         }
         
- template_symbol symbol(ts);
- if(!ts.parent) symbol.parent = &top_scope();
-
- boost::spirit::classic::add(scopes.front().symbols, ts.identifier.c_str(),
- symbol);
+ boost::spirit::classic::add(scopes.front().symbols,
+ ts.identifier.c_str(), ts);
 
         return true;
     }

Modified: branches/release/tools/quickbook/detail/template_stack.hpp
==============================================================================
--- branches/release/tools/quickbook/detail/template_stack.hpp (original)
+++ branches/release/tools/quickbook/detail/template_stack.hpp 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
@@ -21,6 +21,24 @@
 
 namespace quickbook
 {
+ struct template_body
+ {
+ template_body(
+ std::string const& content,
+ boost::spirit::classic::file_position position,
+ bool is_block
+ )
+ : content(content)
+ , position(position)
+ , is_block(is_block)
+ {
+ }
+
+ std::string content;
+ boost::spirit::classic::file_position position;
+ bool is_block;
+ };
+
     struct template_scope;
 
     struct template_symbol
@@ -30,24 +48,26 @@
                 std::vector<std::string> const& params,
                 std::string const& body,
                 boost::spirit::classic::file_position const& position,
+ bool is_block,
                 template_scope const* parent = 0)
            : identifier(identifier)
- , callout(false)
            , params(params)
- , body(body)
- , position(position)
- , parent(parent) {}
+ , body(body, position, is_block)
+ , parent(parent)
+ , callout(false)
+ , callouts() {}
 
         std::string identifier;
- bool callout;
         std::vector<std::string> params;
- std::string body;
- boost::spirit::classic::file_position position;
+ template_body body;
         
         // This is only used for quickbook 1.5+, 1.4 uses the dynamic scope.
         // TODO: I should probably call this something like lexical_parent
         // or static_parent for clarity.
         template_scope const* parent;
+
+ bool callout;
+ std::vector<template_body> callouts;
     };
 
     typedef boost::spirit::classic::symbols<template_symbol> template_symbols;

Modified: branches/release/tools/quickbook/doc/quickbook.qbk
==============================================================================
--- branches/release/tools/quickbook/doc/quickbook.qbk (original)
+++ branches/release/tools/quickbook/doc/quickbook.qbk 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
@@ -219,6 +219,20 @@
   * Correctly restore the quickbook version switch after including a file
     with a different version.
 
+[h3 Version 1.5.3 - Boost 1.45.0]
+
+* Fix command line flag for defining macros.
+* Fix a couple of issues with the code block parser:
+ * A comment with no indentation will now end a code block.
+ * Code blocks no longer have to be followed by a blank line.
+* Improved tracking of file position in templates and imported code blocks.
+* Better generated markup for callout lists.
+* In docbook, variable list entries can only have one `listitem`, so if an
+ entry has multiple values, merge them into one `listitem`.
+* Support nested code snippets.
+* Further work on quickbook 1.6, still not stable.
+ * Allow heading to have ids, using the syntax: `[heading:id title]`.
+
 [endsect]
 
 [section:syntax Syntax Summary]

Modified: branches/release/tools/quickbook/phrase.hpp
==============================================================================
--- branches/release/tools/quickbook/phrase.hpp (original)
+++ branches/release/tools/quickbook/phrase.hpp 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
@@ -132,13 +132,13 @@
                         (eps_p(punct_p)
>> actions.templates.scope
                         ) [assign_a(actions.template_identifier)]
- [clear_a(actions.template_info)]
+ [clear_a(actions.template_args)]
>> !template_args
                     ) | (
                         (actions.templates.scope
>> eps_p(hard_space)
                         ) [assign_a(actions.template_identifier)]
- [clear_a(actions.template_info)]
+ [clear_a(actions.template_args)]
>> space
>> !template_args
                     ) )
@@ -153,30 +153,31 @@
                     ]
                     ;
 
- template_args_1_4 =
- template_arg_1_4 [push_back_a(actions.template_info)]
- >> *(
- ".." >> template_arg_1_4 [push_back_a(actions.template_info)]
+ template_args_1_4 = template_arg_1_4 >> *(".." >> template_arg_1_4);
+
+ template_arg_1_4 =
+ ( eps_p(*blank_p >> eol_p) [assign_a(actions.template_block, true_)]
+ | eps_p [assign_a(actions.template_block, false_)]
                         )
+ >> template_inner_arg_1_4 [actions.template_arg]
                     ;
 
- template_arg_1_4 =
+ template_inner_arg_1_4 =
                     +(brackets_1_4 | (anychar_p - (str_p("..") | ']')))
                     ;
 
                 brackets_1_4 =
- '[' >> +template_arg_1_4 >> ']'
+ '[' >> template_inner_arg_1_4 >> ']'
                     ;
 
- template_args_1_5 =
- template_arg_1_5 [push_back_a(actions.template_info)]
- >> *(
- ".." >> template_arg_1_5 [push_back_a(actions.template_info)]
- )
- ;
+ template_args_1_5 = template_arg_1_5 >> *(".." >> template_arg_1_5);
 
                 template_arg_1_5 =
- +(brackets_1_5 | ('\\' >> anychar_p) | (anychar_p - (str_p("..") | '[' | ']')))
+ ( eps_p(*blank_p >> eol_p) [assign_a(actions.template_block, true_)]
+ | eps_p [assign_a(actions.template_block, false_)]
+ )
+ >> (+(brackets_1_5 | ('\\' >> anychar_p) | (anychar_p - (str_p("..") | '[' | ']'))))
+ [actions.template_arg]
                     ;
 
                 template_inner_arg_1_5 =
@@ -184,7 +185,7 @@
                     ;
 
                 brackets_1_5 =
- '[' >> +template_inner_arg_1_5 >> ']'
+ '[' >> template_inner_arg_1_5 >> ']'
                     ;
 
                 inline_code =
@@ -478,7 +479,8 @@
                             simple_teletype, source_mode, template_,
                             quote, code_block, footnote, replaceable, macro,
                             dummy_block, cond_phrase, macro_identifier, template_args,
- template_args_1_4, template_arg_1_4, brackets_1_4,
+ template_args_1_4, template_arg_1_4,
+ template_inner_arg_1_4, brackets_1_4,
                             template_args_1_5, template_arg_1_5,
                             template_inner_arg_1_5, brackets_1_5
                             ;

Modified: branches/release/tools/quickbook/test/Jamfile.v2
==============================================================================
--- branches/release/tools/quickbook/test/Jamfile.v2 (original)
+++ branches/release/tools/quickbook/test/Jamfile.v2 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
@@ -12,6 +12,7 @@
 
 test-suite quickbook.test :
     [ quickbook-test quickbook-manual ]
+ [ quickbook-test code-block ]
     [ quickbook-test code-block-1 ]
     [ quickbook-test code-block-2 ]
     [ quickbook-test code-block-3 ]
@@ -35,9 +36,11 @@
     [ quickbook-test section_1_4 ]
     [ quickbook-test section_1_5 ]
     [ quickbook-test heading ]
+ [ quickbook-test heading_1_6 ]
     [ quickbook-test identifier_1_5 ]
     [ quickbook-test identifier_1_6 ]
     [ quickbook-test para-test ]
+ [ quickbook-test variablelist ]
     [ quickbook-test table_1_5 ]
     [ quickbook-test image_1_5 ]
     [ quickbook-test list_test ]
@@ -51,6 +54,7 @@
     [ quickbook-test xml-escape_1_2 ]
     [ quickbook-test xml-escape_1_5 ]
     [ quickbook-test blocks ]
+ [ quickbook-test command_line_macro : : : <quickbook-define>__macro__=*bold* ]
     [ quickbook-fail-test fail-include ]
     [ quickbook-fail-test fail-import ]
     [ quickbook-fail-test fail-template-arguments1 ]

Modified: branches/release/tools/quickbook/test/callouts.cpp
==============================================================================
--- branches/release/tools/quickbook/test/callouts.cpp (original)
+++ branches/release/tools/quickbook/test/callouts.cpp 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
@@ -33,3 +33,16 @@
 }
 
 //]
+
+//[ example4
+
+int roll_die() {
+ /*<< callout 1 >>*/
+ boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist);
+//[ example4a
+ /*<< callout 2 >>*/
+ boost::uniform_int<> dist(1, 6); /*< create a uniform_int distribution >*/
+//]
+}
+
+//]

Modified: branches/release/tools/quickbook/test/callouts.gold
==============================================================================
--- branches/release/tools/quickbook/test/callouts.gold (original)
+++ branches/release/tools/quickbook/test/callouts.gold 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
@@ -19,9 +19,13 @@
 
 </programlisting>
   </para>
- <para>
- <calloutlist><callout arearefs="callout_tests0co" id="callout_tests0"><para> create a uniform_int distribution </para></callout></calloutlist>
- </para>
+ <calloutlist>
+ <callout arearefs="callout_tests0co" id="callout_tests0">
+ <para>
+ create a uniform_int distribution
+ </para>
+ </callout>
+ </calloutlist>
   <para>
     Example 2:
   </para>
@@ -33,17 +37,15 @@
 
 </programlisting>
   </para>
- <para>
- <calloutlist><callout arearefs="callout_tests1co" id="callout_tests1"><para>
- </para>
- <important>
- <para>
- test
- </para>
- </important>
- <para>
- </para></callout></calloutlist>
- </para>
+ <calloutlist>
+ <callout arearefs="callout_tests1co" id="callout_tests1">
+ <important>
+ <para>
+ test
+ </para>
+ </important>
+ </callout>
+ </calloutlist>
   <para>
     Example 3:
   </para>
@@ -55,17 +57,15 @@
 
 </programlisting>
   </para>
- <para>
- <calloutlist><callout arearefs="callout_tests2co" id="callout_tests2"><para>
- </para>
- <important>
- <para>
- test
- </para>
- </important>
- <para>
- </para></callout></calloutlist>
- </para>
+ <calloutlist>
+ <callout arearefs="callout_tests2co" id="callout_tests2">
+ <important>
+ <para>
+ test
+ </para>
+ </important>
+ </callout>
+ </calloutlist>
   <para>
     Example 3 (again!):
   </para>
@@ -77,15 +77,59 @@
 
 </programlisting>
   </para>
+ <calloutlist>
+ <callout arearefs="callout_tests3co" id="callout_tests3">
+ <important>
+ <para>
+ test
+ </para>
+ </important>
+ </callout>
+ </calloutlist>
   <para>
- <calloutlist><callout arearefs="callout_tests3co" id="callout_tests3"><para>
+ Example 4:
   </para>
- <important>
- <para>
- test
- </para>
- </important>
   <para>
- </para></callout></calloutlist>
+
+<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">roll_die</phrase><phrase role="special">()</phrase> <phrase role="special">{</phrase>
+ <!--quickbook-escape-prefix--><co id="callout_tests4co" linkends="callout_tests4" /><!--quickbook-escape-postfix--><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">variate_generator</phrase><phrase role="special">&lt;</phrase><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">mt19937</phrase><phrase role="special">&amp;,</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special">&lt;&gt;</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">die</phrase><phrase role="special">(</phrase><phrase role="identifier">gen</phrase><phrase role="special">,</phrase> <phrase role="identifier">dist</phrase><phrase role="special">);</phrase>
+<!--quickbook-escape-prefix--><co id="callout_tests5co" linkends="callout_tests5" /><!--quickbook-escape-postfix--><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special">&lt;&gt;</phrase> <phrase role="identifier">dist</phrase><phrase role="special">(</phrase><phrase role="number">1</phrase><phrase role="special">,</phrase> <phrase role="number">6</phrase><phrase role="special">);</phrase> <!--quickbook-escape-prefix--><co id="callout_tests6co" linkends="callout_tests6" /><!--quickbook-escape-postfix-->
+<phrase role="special">}</phrase>
+
+</programlisting>
+ </para>
+ <calloutlist>
+ <callout arearefs="callout_tests4co" id="callout_tests4">
+ <para>
+ callout 1
+ </para>
+ </callout>
+ <callout arearefs="callout_tests5co" id="callout_tests5">
+ <para>
+ callout 2
+ </para>
+ </callout>
+ <callout arearefs="callout_tests6co" id="callout_tests6">
+ <para>
+ create a uniform_int distribution
+ </para>
+ </callout>
+ </calloutlist>
+ <para>
+
+<programlisting><!--quickbook-escape-prefix--><co id="callout_tests7co" linkends="callout_tests7" /><!--quickbook-escape-postfix--><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">uniform_int</phrase><phrase role="special">&lt;&gt;</phrase> <phrase role="identifier">dist</phrase><phrase role="special">(</phrase><phrase role="number">1</phrase><phrase role="special">,</phrase> <phrase role="number">6</phrase><phrase role="special">);</phrase> <!--quickbook-escape-prefix--><co id="callout_tests8co" linkends="callout_tests8" /><!--quickbook-escape-postfix-->
+</programlisting>
   </para>
+ <calloutlist>
+ <callout arearefs="callout_tests7co" id="callout_tests7">
+ <para>
+ callout 2
+ </para>
+ </callout>
+ <callout arearefs="callout_tests8co" id="callout_tests8">
+ <para>
+ create a uniform_int distribution
+ </para>
+ </callout>
+ </calloutlist>
 </article>

Modified: branches/release/tools/quickbook/test/callouts.quickbook
==============================================================================
--- branches/release/tools/quickbook/test/callouts.quickbook (original)
+++ branches/release/tools/quickbook/test/callouts.quickbook 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
@@ -19,3 +19,8 @@
 Example 3 (again!):
 
 [example3]
+
+Example 4:
+
+[example4]
+[example4a]

Modified: branches/release/tools/quickbook/test/heading.gold
==============================================================================
--- branches/release/tools/quickbook/test/heading.gold (original)
+++ branches/release/tools/quickbook/test/heading.gold 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
@@ -11,4 +11,18 @@
   <para>
     Testing headers without sections.
   </para>
+ <anchor id="header._not_an_id"/>
+ <bridgehead renderas="sect2">
+ <link linkend="header._not_an_id">:Not an Id</link>
+ </bridgehead>
+ <para>
+ Paragraph.
+ </para>
+ <anchor id="header._not_an_id_again"/>
+ <bridgehead renderas="sect3">
+ <link linkend="header._not_an_id_again">:Not an Id again</link>
+ </bridgehead>
+ <para>
+ Paragraph.
+ </para>
 </article>

Modified: branches/release/tools/quickbook/test/heading.quickbook
==============================================================================
--- branches/release/tools/quickbook/test/heading.quickbook (original)
+++ branches/release/tools/quickbook/test/heading.quickbook 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
@@ -5,4 +5,12 @@
 
 [heading Header Test]
 
-Testing headers without sections.
\ No newline at end of file
+Testing headers without sections.
+
+[heading:Not an Id]
+
+Paragraph.
+
+[h3:Not an Id again]
+
+Paragraph.
\ No newline at end of file

Modified: branches/release/tools/quickbook/test/include_1_5.gold
==============================================================================
--- branches/release/tools/quickbook/test/include_1_5.gold (original)
+++ branches/release/tools/quickbook/test/include_1_5.gold 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
@@ -6,13 +6,13 @@
   <articleinfo>
   </articleinfo>
   <section id="include_test_sub_document.test">
- <title><link linkend="include_test_sub_document.test"> Test</link></title>
+ <title><link linkend="include_test_sub_document.test">Test</link></title>
     <para>
       Just testing.
     </para>
   </section>
   <section id="foo.test">
- <title><link linkend="foo.test"> Test</link></title>
+ <title><link linkend="foo.test">Test</link></title>
     <para>
       Just testing.
     </para>

Modified: branches/release/tools/quickbook/test/include_1_6-2.gold
==============================================================================
--- branches/release/tools/quickbook/test/include_1_6-2.gold (original)
+++ branches/release/tools/quickbook/test/include_1_6-2.gold 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
@@ -6,13 +6,13 @@
   <articleinfo>
   </articleinfo>
   <section id="include-test.test">
- <title><link linkend="include-test.test"> Test</link></title>
+ <title><link linkend="include-test.test">Test</link></title>
     <para>
       Just testing.
     </para>
   </section>
   <section id="foo.test">
- <title><link linkend="foo.test"> Test</link></title>
+ <title><link linkend="foo.test">Test</link></title>
     <para>
       Just testing.
     </para>

Modified: branches/release/tools/quickbook/test/include_1_6.gold
==============================================================================
--- branches/release/tools/quickbook/test/include_1_6.gold (original)
+++ branches/release/tools/quickbook/test/include_1_6.gold 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
@@ -6,13 +6,13 @@
   <articleinfo>
   </articleinfo>
   <section id="include-test.test">
- <title><link linkend="include-test.test"> Test</link></title>
+ <title><link linkend="include-test.test">Test</link></title>
     <para>
       Just testing.
     </para>
   </section>
   <section id="foo.test">
- <title><link linkend="foo.test"> Test</link></title>
+ <title><link linkend="foo.test">Test</link></title>
     <para>
       Just testing.
     </para>

Modified: branches/release/tools/quickbook/test/list_test.gold
==============================================================================
--- branches/release/tools/quickbook/test/list_test.gold (original)
+++ branches/release/tools/quickbook/test/list_test.gold 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
@@ -41,36 +41,36 @@
     <listitem>
       <simpara>
         A
- <itemizedlist>
- <listitem>
- <simpara>
- A
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- B
- </simpara>
- </listitem>
- </itemizedlist>
       </simpara>
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ A
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ B
+ </simpara>
+ </listitem>
+ </itemizedlist>
     </listitem>
     <listitem>
       <simpara>
         B
- <itemizedlist>
- <listitem>
- <simpara>
- A
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- B
- </simpara>
- </listitem>
- </itemizedlist>
       </simpara>
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ A
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ B
+ </simpara>
+ </listitem>
+ </itemizedlist>
     </listitem>
   </itemizedlist>
   <para>
@@ -80,36 +80,36 @@
     <listitem>
       <simpara>
         A
- <itemizedlist>
- <listitem>
- <simpara>
- A
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- B
- </simpara>
- </listitem>
- </itemizedlist>
       </simpara>
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ A
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ B
+ </simpara>
+ </listitem>
+ </itemizedlist>
     </listitem>
     <listitem>
       <simpara>
         B
- <itemizedlist>
- <listitem>
- <simpara>
- A
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- B
- </simpara>
- </listitem>
- </itemizedlist>
       </simpara>
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ A
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ B
+ </simpara>
+ </listitem>
+ </itemizedlist>
     </listitem>
   </orderedlist>
   <para>
@@ -119,53 +119,53 @@
     <listitem>
       <simpara>
         A
- <itemizedlist>
- <listitem>
- <simpara>
- A
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- B
- <itemizedlist>
- <listitem>
- <simpara>
- C
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- D
- </simpara>
- </listitem>
- </itemizedlist>
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- E
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- F
- <itemizedlist>
- <listitem>
- <simpara>
- G
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- H
- </simpara>
- </listitem>
- </itemizedlist>
- </simpara>
- </listitem>
- </itemizedlist>
       </simpara>
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ A
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ B
+ </simpara>
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ C
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ D
+ </simpara>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <simpara>
+ E
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ F
+ </simpara>
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ G
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ H
+ </simpara>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </itemizedlist>
     </listitem>
   </orderedlist>
   <para>
@@ -175,31 +175,31 @@
     <listitem>
       <simpara>
         A
- <itemizedlist>
- <listitem>
- <simpara>
- A
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- B
- <orderedlist>
- <listitem>
- <simpara>
- C
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- D
- </simpara>
- </listitem>
- </orderedlist>
- </simpara>
- </listitem>
- </itemizedlist>
       </simpara>
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ A
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ B
+ </simpara>
+ <orderedlist>
+ <listitem>
+ <simpara>
+ C
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ D
+ </simpara>
+ </listitem>
+ </orderedlist>
+ </listitem>
+ </itemizedlist>
     </listitem>
     <listitem>
       <simpara>

Modified: branches/release/tools/quickbook/test/quickbook-manual.gold
==============================================================================
--- branches/release/tools/quickbook/test/quickbook-manual.gold (original)
+++ branches/release/tools/quickbook/test/quickbook-manual.gold 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
@@ -26,7 +26,7 @@
     </articlepurpose>
   </articleinfo>
   <section id="quickbook.intro">
- <title><link linkend="quickbook.intro"> Introduction</link></title>
+ <title><link linkend="quickbook.intro">Introduction</link></title>
     <blockquote>
       <para>
         <emphasis role="bold"><emphasis><quote>Why program by hand in five days what
@@ -102,7 +102,7 @@
     </itemizedlist>
   </section>
   <section id="quickbook.change_log">
- <title><link linkend="quickbook.change_log"> Change Log</link></title> <anchor
+ <title><link linkend="quickbook.change_log">Change Log</link></title> <anchor
     id="quickbook.change_log.version_1_3"/>
     <bridgehead renderas="sect3">
       <link linkend="quickbook.change_log.version_1_3">Version 1.3</link>
@@ -279,7 +279,7 @@
     </itemizedlist>
   </section>
   <section id="quickbook.syntax">
- <title><link linkend="quickbook.syntax"> Syntax Summary</link></title>
+ <title><link linkend="quickbook.syntax">Syntax Summary</link></title>
     <para>
       A QuickBook document is composed of one or more blocks. An example of a block
       is the paragraph or a C++ code snippet. Some blocks have special mark-ups.
@@ -311,7 +311,7 @@
 </programlisting>
     </section>
     <section id="quickbook.syntax.phrase">
- <title><link linkend="quickbook.syntax.phrase"> Phrase Level Elements</link></title>
+ <title><link linkend="quickbook.syntax.phrase">Phrase Level Elements</link></title>
       <section id="quickbook.syntax.phrase.font_styles">
         <title><link linkend="quickbook.syntax.phrase.font_styles">Font Styles</link></title>
         
@@ -928,7 +928,7 @@
         </para>
       </section>
       <section id="quickbook.syntax.phrase.code_links">
- <title><link linkend="quickbook.syntax.phrase.code_links"> Code Links</link></title>
+ <title><link linkend="quickbook.syntax.phrase.code_links">Code Links</link></title>
         <para>
           If you want to link to a function, class, member, enum, concept or header
           in the reference section, you can use:
@@ -1058,7 +1058,7 @@
       </section>
     </section>
     <section id="quickbook.syntax.block">
- <title><link linkend="quickbook.syntax.block"> Block Level Elements</link></title>
+ <title><link linkend="quickbook.syntax.block">Block Level Elements</link></title>
       <section id="quickbook.syntax.block.document">
         <title><link linkend="quickbook.syntax.block.document">Document</link></title>
         <para>
@@ -1272,48 +1272,48 @@
             <listitem>
               <simpara>
                 Three
- <orderedlist>
- <listitem>
- <simpara>
- Three.a
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- Three.b
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- Three.c
- </simpara>
- </listitem>
- </orderedlist>
               </simpara>
+ <orderedlist>
+ <listitem>
+ <simpara>
+ Three.a
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ Three.b
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ Three.c
+ </simpara>
+ </listitem>
+ </orderedlist>
             </listitem>
             <listitem>
               <simpara>
                 Fourth
- <orderedlist>
- <listitem>
- <simpara>
- Four.a
- <orderedlist>
- <listitem>
- <simpara>
- Four.a.i
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- Four.a.ii
- </simpara>
- </listitem>
- </orderedlist>
- </simpara>
- </listitem>
- </orderedlist>
               </simpara>
+ <orderedlist>
+ <listitem>
+ <simpara>
+ Four.a
+ </simpara>
+ <orderedlist>
+ <listitem>
+ <simpara>
+ Four.a.i
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ Four.a.ii
+ </simpara>
+ </listitem>
+ </orderedlist>
+ </listitem>
+ </orderedlist>
             </listitem>
             <listitem>
               <simpara>
@@ -1418,24 +1418,24 @@
             <listitem>
               <simpara>
                 Three
- <itemizedlist>
- <listitem>
- <simpara>
- Three.a
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- Three.b
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- Three.c
- </simpara>
- </listitem>
- </itemizedlist>
               </simpara>
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ Three.a
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ Three.b
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ Three.c
+ </simpara>
+ </listitem>
+ </itemizedlist>
             </listitem>
             <listitem>
               <simpara>
@@ -1467,72 +1467,72 @@
             <listitem>
               <simpara>
                 1
- <itemizedlist>
- <listitem>
- <simpara>
- 1.a
- <orderedlist>
- <listitem>
- <simpara>
- 1.a.1
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- 1.a.2
- </simpara>
- </listitem>
- </orderedlist>
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- 1.b
- </simpara>
- </listitem>
- </itemizedlist>
               </simpara>
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ 1.a
+ </simpara>
+ <orderedlist>
+ <listitem>
+ <simpara>
+ 1.a.1
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ 1.a.2
+ </simpara>
+ </listitem>
+ </orderedlist>
+ </listitem>
+ <listitem>
+ <simpara>
+ 1.b
+ </simpara>
+ </listitem>
+ </itemizedlist>
             </listitem>
             <listitem>
               <simpara>
                 2
- <itemizedlist>
- <listitem>
- <simpara>
- 2.a
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- 2.b
- <orderedlist>
+ </simpara>
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ 2.a
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ 2.b
+ </simpara>
+ <orderedlist>
+ <listitem>
+ <simpara>
+ 2.b.1
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ 2.b.2
+ </simpara>
+ <itemizedlist>
                         <listitem>
                           <simpara>
- 2.b.1
+ 2.b.2.a
                           </simpara>
                         </listitem>
                         <listitem>
                           <simpara>
- 2.b.2
- <itemizedlist>
- <listitem>
- <simpara>
- 2.b.2.a
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- 2.b.2.b
- </simpara>
- </listitem>
- </itemizedlist>
+ 2.b.2.b
                           </simpara>
                         </listitem>
- </orderedlist>
- </simpara>
- </listitem>
- </itemizedlist>
- </simpara>
+ </itemizedlist>
+ </listitem>
+ </orderedlist>
+ </listitem>
+ </itemizedlist>
             </listitem>
           </orderedlist>
         </section>
@@ -1579,8 +1579,8 @@
 </programlisting>
       </section>
       <section id="quickbook.syntax.block.escape_back">
- <title><link linkend="quickbook.syntax.block.escape_back"> Escaping Back
- To QuickBook</link></title>
+ <title><link linkend="quickbook.syntax.block.escape_back">Escaping Back To
+ QuickBook</link></title>
         <para>
           Inside code, code blocks and inline code, QuickBook does not allow any
           markup to avoid conflicts with the target syntax (e.g. c++). In case you
@@ -2802,10 +2802,19 @@
 <phrase role="special">}</phrase>
 </programlisting>
         </para>
- <para>
- <calloutlist><callout arearefs="quickbook0co" id="quickbook0"><para> The <emphasis>Mythical</emphasis> FooBar. See <ulink url="http://en.wikipedia.org/wiki/Foobar">Foobar
- for details</ulink> </para></callout><callout arearefs="quickbook1co" id="quickbook1"><para> return 'em, foo-bar man! </para></callout></calloutlist>
- </para>
+ <calloutlist>
+ <callout arearefs="quickbook0co" id="quickbook0">
+ <para>
+ The <emphasis>Mythical</emphasis> FooBar. See <ulink url="http://en.wikipedia.org/wiki/Foobar">Foobar
+ for details</ulink>
+ </para>
+ </callout>
+ <callout arearefs="quickbook1co" id="quickbook1">
+ <para>
+ return 'em, foo-bar man!
+ </para>
+ </callout>
+ </calloutlist>
         <para>
           Checkout <ulink url="../../test/stub.cpp">stub.cpp</ulink> to see the actual
           code.
@@ -2814,7 +2823,7 @@
     </section>
   </section>
   <section id="quickbook.install">
- <title><link linkend="quickbook.install"> Installation and configuration</link></title>
+ <title><link linkend="quickbook.install">Installation and configuration</link></title>
     <para>
       This section provides some guidelines on how to install and configure BoostBook
       and Quickbook under several operating systems.
@@ -2828,7 +2837,7 @@
       trying again. Otherwise your configuration fixes will not take any effect.
     </para>
     <section id="quickbook.install.windows">
- <title><link linkend="quickbook.install.windows"> Windows 2000, XP, 2003, Vista</link></title>
+ <title><link linkend="quickbook.install.windows">Windows 2000, XP, 2003, Vista</link></title>
       <blockquote>
         <para>
           <emphasis>Section contributed by Julio M. Merino Vidal</emphasis>
@@ -2979,7 +2988,7 @@
 </programlisting>
     </section>
     <section id="quickbook.install.linux">
- <title><link linkend="quickbook.install.linux"> Debian, Ubuntu</link></title>
+ <title><link linkend="quickbook.install.linux">Debian, Ubuntu</link></title>
       <para>
         The following instructions apply to Debian and its derivatives. They are
         based on a Ubuntu Edgy install but should work on other Debian based systems.
@@ -3070,7 +3079,7 @@
     </section>
   </section>
   <section id="quickbook.editors">
- <title><link linkend="quickbook.editors"> Editor Support</link></title>
+ <title><link linkend="quickbook.editors">Editor Support</link></title>
     <para>
       Editing quickbook files is usually done with text editors both simple and powerful.
       The following sections list the settings for some editors which can help make
@@ -3088,7 +3097,7 @@
     </para>
     </sidebar>
     <section id="quickbook.editors.scite">
- <title><link linkend="quickbook.editors.scite"> Scintilla Text Editor</link></title>
+ <title><link linkend="quickbook.editors.scite">Scintilla Text Editor</link></title>
       <blockquote>
         <para>
           <emphasis>Section contributed by Dean Michael Berris</emphasis>
@@ -3136,7 +3145,7 @@
     </section>
   </section>
   <section id="quickbook.faq">
- <title><link linkend="quickbook.faq"> Frequently Asked Questions</link></title>
+ <title><link linkend="quickbook.faq">Frequently Asked Questions</link></title>
     <anchor id="quickbook.faq.can_i_use_quickbook_for_non_boost_documentation_"/>
     <bridgehead renderas="sect3">
       <link linkend="quickbook.faq.can_i_use_quickbook_for_non_boost_documentation_">Can
@@ -3178,7 +3187,7 @@
 </programlisting>
   </section>
   <section id="quickbook.ref">
- <title><link linkend="quickbook.ref"> Quick Reference</link></title>
+ <title><link linkend="quickbook.ref">Quick Reference</link></title>
     <para>
       [cpp]
     </para>

Modified: branches/release/tools/quickbook/test/quickbook-testing.jam
==============================================================================
--- branches/release/tools/quickbook/test/quickbook-testing.jam (original)
+++ branches/release/tools/quickbook/test/quickbook-testing.jam 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
@@ -16,6 +16,7 @@
 import type ;
 
 feature.feature quickbook-testing.quickbook-command : : free dependency ;
+feature.feature <quickbook-define> : : free ;
 
 type.register QUICKBOOK_INPUT : quickbook ;
 type.register QUICKBOOK_OUTPUT ;
@@ -94,6 +95,8 @@
 
 ################################################################################
 toolset.flags quickbook-testing.process-quickbook quickbook-command <quickbook-testing.quickbook-command> ;
+toolset.flags quickbook-testing.process-quickbook QB-DEFINES <quickbook-define> ;
+
 rule process-quickbook ( target : source : properties * )
 {
     DEPENDS $(target) : [ on $(target) return $(quickbook-command) ] ;
@@ -101,6 +104,6 @@
 
 actions process-quickbook bind quickbook-command
 {
- $(quickbook-command) $(>) --output-file=$(<) --debug
+ $(quickbook-command) $(>) --output-file=$(<) --debug -D"$(QB-DEFINES)"
 }
 

Modified: branches/release/tools/quickbook/test/section_1_4.gold
==============================================================================
--- branches/release/tools/quickbook/test/section_1_4.gold (original)
+++ branches/release/tools/quickbook/test/section_1_4.gold 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
@@ -6,13 +6,13 @@
   <articleinfo>
   </articleinfo>
   <section id="section_id_1_4.id_test1">
- <title><link linkend="section_id_1_4.id_test1"> Quickbook section id test</link></title>
+ <title><link linkend="section_id_1_4.id_test1">Quickbook section id test</link></title>
   </section>
   <section id="section_id_1_4.id_test2">
- <title><link linkend="section_id_1_4.id_test2"> Quickbook section id test</link></title>
+ <title><link linkend="section_id_1_4.id_test2">Quickbook section id test</link></title>
   </section>
- <section id="section_id_1_4._quickbook_section_no_id_test_1">
- <title><link linkend="section_id_1_4._quickbook_section_no_id_test_1"> Quickbook
+ <section id="section_id_1_4.quickbook_section_no_id_test_1">
+ <title><link linkend="section_id_1_4.quickbook_section_no_id_test_1">Quickbook
     section no id test 1</link></title>
   </section>
   <section id="section_id_1_4.___quickbook_section_no_id_test_2">

Modified: branches/release/tools/quickbook/test/section_1_5.gold
==============================================================================
--- branches/release/tools/quickbook/test/section_1_5.gold (original)
+++ branches/release/tools/quickbook/test/section_1_5.gold 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
@@ -6,13 +6,13 @@
   <articleinfo>
   </articleinfo>
   <section id="section_id_1_5.id_test1">
- <title><link linkend="section_id_1_5.id_test1"> Quickbook section id test</link></title>
+ <title><link linkend="section_id_1_5.id_test1">Quickbook section id test</link></title>
   </section>
   <section id="section_id_1_5.id_test2">
- <title><link linkend="section_id_1_5.id_test2"> Quickbook section id test</link></title>
+ <title><link linkend="section_id_1_5.id_test2">Quickbook section id test</link></title>
   </section>
   <section id="section_id_1_5.id_test3">
- <title><link linkend="section_id_1_5.id_test3"> Quickbook section id test</link></title>
+ <title><link linkend="section_id_1_5.id_test3">Quickbook section id test</link></title>
   </section>
   <section id="section_id_1_5.___quickbook_section_no_id_test">
     <title><link linkend="section_id_1_5.___quickbook_section_no_id_test">++ Quickbook

Modified: branches/release/tools/quickbook/test/table_1_5.gold
==============================================================================
--- branches/release/tools/quickbook/test/table_1_5.gold (original)
+++ branches/release/tools/quickbook/test/table_1_5.gold 2010-08-24 03:52:19 EDT (Tue, 24 Aug 2010)
@@ -118,7 +118,7 @@
     </tgroup>
   </table>
   <section id="table_1_5.section1">
- <title><link linkend="table_1_5.section1"> Section 1</link></title>
+ <title><link linkend="table_1_5.section1">Section 1</link></title>
     <table frame="all" id="table_1_5.section1.table1">
       <title>Table 1</title>
       <tgroup cols="1">


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