Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75529 - in branches/quickbook-dev/tools/quickbook: src test/doc-info test/include
From: dnljms_at_[hidden]
Date: 2011-11-17 16:04:29


Author: danieljames
Date: 2011-11-17 16:04:27 EST (Thu, 17 Nov 2011)
New Revision: 75529
URL: http://svn.boost.org/trac/boost/changeset/75529

Log:
Quickbook: Trim trailing space from document title.
Added:
   branches/quickbook-dev/tools/quickbook/test/doc-info/title_trailing_space-1_1.gold
      - copied, changed from r75528, /branches/quickbook-dev/tools/quickbook/test/include/source_mode-1_5.gold
   branches/quickbook-dev/tools/quickbook/test/doc-info/title_trailing_space-1_1.quickbook (contents, props changed)
   branches/quickbook-dev/tools/quickbook/test/doc-info/title_trailing_space-1_6.gold (contents, props changed)
   branches/quickbook-dev/tools/quickbook/test/doc-info/title_trailing_space-1_6.quickbook (contents, props changed)
Text files modified:
   branches/quickbook-dev/tools/quickbook/src/doc_info_actions.cpp | 9 ++++++++-
   branches/quickbook-dev/tools/quickbook/src/doc_info_grammar.cpp | 8 +++++++-
   branches/quickbook-dev/tools/quickbook/test/doc-info/Jamfile.v2 | 2 ++
   branches/quickbook-dev/tools/quickbook/test/doc-info/title_trailing_space-1_1.gold | 8 +++++---
   branches/quickbook-dev/tools/quickbook/test/include/source_mode-1_5.gold | 2 +-
   5 files changed, 23 insertions(+), 6 deletions(-)

Modified: branches/quickbook-dev/tools/quickbook/src/doc_info_actions.cpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/doc_info_actions.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/doc_info_actions.cpp 2011-11-17 16:04:27 EST (Thu, 17 Nov 2011)
@@ -26,7 +26,14 @@
     
     static std::string doc_info_output(value const& p, unsigned version)
     {
- return (qbk_version_n < version) ? p.get_quickbook() : p.get_boostbook();
+ if (qbk_version_n < version) {
+ std::string value = p.get_quickbook();
+ value.erase(value.find_last_not_of(" \t") + 1);
+ return value;
+ }
+ else {
+ return p.get_boostbook();
+ }
     }
 
     // Each docinfo attribute is stored in a value list, these are then stored

Modified: branches/quickbook-dev/tools/quickbook/src/doc_info_grammar.cpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/doc_info_grammar.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/doc_info_grammar.cpp 2011-11-17 16:04:27 EST (Thu, 17 Nov 2011)
@@ -129,7 +129,13 @@
                                             [actions.values.entry(ph::arg1, ph::arg2, doc_info_tags::type)]
>> hard_space
>> actions.to_value(doc_info_tags::title)
- [ *(~cl::eps_p(cl::ch_p('[') | ']' | cl::eol_p) >> local.char_) ]
+ [ *( ~cl::eps_p(blank >> (cl::ch_p('[') | ']' | cl::eol_p))
+ >> local.char_
+ )
+ // Include 'blank' here so that it will be included in
+ // id generation.
+ >> blank
+ ]
>> space
>> !(qbk_since(106u) >> cl::eps_p(ph::var(local.source_mode_unset))
                                             [cl::assign_a(actions.source_mode, "c++")]

Modified: branches/quickbook-dev/tools/quickbook/test/doc-info/Jamfile.v2
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/doc-info/Jamfile.v2 (original)
+++ branches/quickbook-dev/tools/quickbook/test/doc-info/Jamfile.v2 2011-11-17 16:04:27 EST (Thu, 17 Nov 2011)
@@ -25,4 +25,6 @@
     [ quickbook-error-test copyright-fail1 ]
     [ quickbook-error-test copyright-fail2 ]
     [ quickbook-test id1-1.5 ]
+ [ quickbook-test title_trailing_space-1_1 ]
+ [ quickbook-test title_trailing_space-1_6 ]
     ;

Copied: branches/quickbook-dev/tools/quickbook/test/doc-info/title_trailing_space-1_1.gold (from r75528, /branches/quickbook-dev/tools/quickbook/test/include/source_mode-1_5.gold)
==============================================================================
--- /branches/quickbook-dev/tools/quickbook/test/include/source_mode-1_5.gold (original)
+++ branches/quickbook-dev/tools/quickbook/test/doc-info/title_trailing_space-1_1.gold 2011-11-17 16:04:27 EST (Thu, 17 Nov 2011)
@@ -1,7 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
-<article id="souce_mode_include_" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $"
+<article id="trailing_space_____" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $"
  xmlns:xi="http://www.w3.org/2001/XInclude">
- <title>Souce Mode Include </title>
-<programlisting>void main() {}</programlisting>
+ <title>Trailing Space</title>
+ <section id="trailing_space_____.body">
+ <title>Body</title>
+ </section>
 </article>

Added: branches/quickbook-dev/tools/quickbook/test/doc-info/title_trailing_space-1_1.quickbook
==============================================================================
--- (empty file)
+++ branches/quickbook-dev/tools/quickbook/test/doc-info/title_trailing_space-1_1.quickbook 2011-11-17 16:04:27 EST (Thu, 17 Nov 2011)
@@ -0,0 +1,5 @@
+[article Trailing Space ]
+
+[section Body]
+
+[endsect]
\ No newline at end of file

Added: branches/quickbook-dev/tools/quickbook/test/doc-info/title_trailing_space-1_6.gold
==============================================================================
--- (empty file)
+++ branches/quickbook-dev/tools/quickbook/test/doc-info/title_trailing_space-1_6.gold 2011-11-17 16:04:27 EST (Thu, 17 Nov 2011)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
+<article id="trailing_space" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
+ <title>Trailing Space</title>
+ <section id="trailing_space.body">
+ <title><link linkend="trailing_space.body">Body</link></title>
+ </section>
+</article>

Added: branches/quickbook-dev/tools/quickbook/test/doc-info/title_trailing_space-1_6.quickbook
==============================================================================
--- (empty file)
+++ branches/quickbook-dev/tools/quickbook/test/doc-info/title_trailing_space-1_6.quickbook 2011-11-17 16:04:27 EST (Thu, 17 Nov 2011)
@@ -0,0 +1,5 @@
+[article Trailing Space [quickbook 1.6]]
+
+[section Body]
+
+[endsect]
\ No newline at end of file

Modified: branches/quickbook-dev/tools/quickbook/test/include/source_mode-1_5.gold
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/include/source_mode-1_5.gold (original)
+++ branches/quickbook-dev/tools/quickbook/test/include/source_mode-1_5.gold 2011-11-17 16:04:27 EST (Thu, 17 Nov 2011)
@@ -2,6 +2,6 @@
 <!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
 <article id="souce_mode_include_" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $"
  xmlns:xi="http://www.w3.org/2001/XInclude">
- <title>Souce Mode Include </title>
+ <title>Souce Mode Include</title>
 <programlisting>void main() {}</programlisting>
 </article>


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