Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r70176 - in trunk/tools/quickbook: . doc src test test/doc-info
From: dnljms_at_[hidden]
Date: 2011-03-19 06:47:04


Author: danieljames
Date: 2011-03-19 06:47:02 EDT (Sat, 19 Mar 2011)
New Revision: 70176
URL: http://svn.boost.org/trac/boost/changeset/70176

Log:
Quickbook: doc info improvements.

- Fix handling empty category attributes.
- Quickbook 1.6: Scope source mode changes to the file they're made in.

Added:
   trunk/tools/quickbook/test/doc-info/
      - copied from r68880, /branches/quickbook-filenames/tools/quickbook/test/doc-info/
   trunk/tools/quickbook/test/doc-info/Jamfile.v2
      - copied unchanged from r68880, /branches/quickbook-filenames/tools/quickbook/test/doc-info/Jamfile.v2
   trunk/tools/quickbook/test/doc-info/author1.gold
      - copied unchanged from r68880, /branches/quickbook-filenames/tools/quickbook/test/doc-info/author1.gold
   trunk/tools/quickbook/test/doc-info/author1.quickbook
      - copied unchanged from r68880, /branches/quickbook-filenames/tools/quickbook/test/doc-info/author1.quickbook
   trunk/tools/quickbook/test/doc-info/author2.gold
      - copied unchanged from r68880, /branches/quickbook-filenames/tools/quickbook/test/doc-info/author2.gold
   trunk/tools/quickbook/test/doc-info/author2.quickbook
      - copied unchanged from r68880, /branches/quickbook-filenames/tools/quickbook/test/doc-info/author2.quickbook
   trunk/tools/quickbook/test/doc-info/duplicates-1.1.gold
      - copied unchanged from r68880, /branches/quickbook-filenames/tools/quickbook/test/doc-info/duplicates-1.1.gold
   trunk/tools/quickbook/test/doc-info/duplicates-1.1.quickbook
      - copied unchanged from r68880, /branches/quickbook-filenames/tools/quickbook/test/doc-info/duplicates-1.1.quickbook
   trunk/tools/quickbook/test/doc-info/duplicates-1.5.gold
      - copied unchanged from r68880, /branches/quickbook-filenames/tools/quickbook/test/doc-info/duplicates-1.5.gold
   trunk/tools/quickbook/test/doc-info/duplicates-1.5.quickbook
      - copied unchanged from r68880, /branches/quickbook-filenames/tools/quickbook/test/doc-info/duplicates-1.5.quickbook
   trunk/tools/quickbook/test/doc-info/empty-attributes.gold
      - copied unchanged from r68880, /branches/quickbook-filenames/tools/quickbook/test/doc-info/empty-attributes.gold
   trunk/tools/quickbook/test/doc-info/empty-attributes.quickbook
      - copied unchanged from r68880, /branches/quickbook-filenames/tools/quickbook/test/doc-info/empty-attributes.quickbook
   trunk/tools/quickbook/test/doc-info/encode-1.5.gold
      - copied unchanged from r68880, /branches/quickbook-filenames/tools/quickbook/test/doc-info/encode-1.5.gold
   trunk/tools/quickbook/test/doc-info/encode-1.5.quickbook
      - copied unchanged from r68880, /branches/quickbook-filenames/tools/quickbook/test/doc-info/encode-1.5.quickbook
   trunk/tools/quickbook/test/doc-info/escape-1.6.gold
      - copied unchanged from r68880, /branches/quickbook-filenames/tools/quickbook/test/doc-info/escape-1.6.gold
   trunk/tools/quickbook/test/doc-info/escape-1.6.quickbook
      - copied unchanged from r68880, /branches/quickbook-filenames/tools/quickbook/test/doc-info/escape-1.6.quickbook
   trunk/tools/quickbook/test/doc-info/source-mode-1.4.gold
      - copied unchanged from r68880, /branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-1.4.gold
   trunk/tools/quickbook/test/doc-info/source-mode-1.4.quickbook
      - copied unchanged from r68880, /branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-1.4.quickbook
   trunk/tools/quickbook/test/doc-info/source-mode-1.5.gold
      - copied unchanged from r68880, /branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-1.5.gold
   trunk/tools/quickbook/test/doc-info/source-mode-1.5.quickbook
      - copied unchanged from r68880, /branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-1.5.quickbook
   trunk/tools/quickbook/test/doc-info/source-mode-1.6.gold
      - copied unchanged from r68880, /branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-1.6.gold
   trunk/tools/quickbook/test/doc-info/source-mode-1.6.quickbook
      - copied unchanged from r68880, /branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-1.6.quickbook
   trunk/tools/quickbook/test/doc-info/source-mode-cpp-include.quickbook
      - copied unchanged from r68880, /branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-cpp-include.quickbook
   trunk/tools/quickbook/test/doc-info/source-mode-python-include.quickbook
      - copied unchanged from r68880, /branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-python-include.quickbook
   trunk/tools/quickbook/test/doc-info/source-mode-teletype-include.quickbook
      - copied unchanged from r68880, /branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-teletype-include.quickbook
Removed:
   trunk/tools/quickbook/test/doc-info-1.gold
   trunk/tools/quickbook/test/doc-info-1.quickbook
   trunk/tools/quickbook/test/doc-info-2.gold
   trunk/tools/quickbook/test/doc-info-2.quickbook
   trunk/tools/quickbook/test/doc-info-3.gold
   trunk/tools/quickbook/test/doc-info-3.quickbook
   trunk/tools/quickbook/test/doc-info-4.gold
   trunk/tools/quickbook/test/doc-info-4.quickbook
Properties modified:
   trunk/tools/quickbook/ (props changed)
Text files modified:
   trunk/tools/quickbook/doc/quickbook.qbk | 3 +++
   trunk/tools/quickbook/src/actions.cpp | 7 +++++--
   trunk/tools/quickbook/src/doc_info_actions.cpp | 13 ++++++++-----
   trunk/tools/quickbook/test/Jamfile.v2 | 6 ++----
   4 files changed, 18 insertions(+), 11 deletions(-)

Modified: trunk/tools/quickbook/doc/quickbook.qbk
==============================================================================
--- trunk/tools/quickbook/doc/quickbook.qbk (original)
+++ trunk/tools/quickbook/doc/quickbook.qbk 2011-03-19 06:47:02 EDT (Sat, 19 Mar 2011)
@@ -272,6 +272,9 @@
 * Fix relative path detection on windows.
 * Reverse deprecation of `[br]`, printing a single warning about
   generating invalid boostbook.
+* Fix handling empty category attributes.
+* Quickbook 1.6:
+ * Scope source mode changes to the file they're made in.
 
 [endsect] [/Change log]
 

Modified: trunk/tools/quickbook/src/actions.cpp
==============================================================================
--- trunk/tools/quickbook/src/actions.cpp (original)
+++ trunk/tools/quickbook/src/actions.cpp 2011-03-19 06:47:02 EDT (Sat, 19 Mar 2011)
@@ -1459,7 +1459,7 @@
         // swap the filenames
         std::swap(actions.filename, filein);
 
- // save the doc info strings
+ // save the doc info strings and source mode
         if(qbk_version_n >= 106) {
             doc_type = actions.doc_type;
             doc_id = actions.doc_id;
@@ -1473,7 +1473,8 @@
             actions.doc_last_revision.swap(doc_last_revision);
         }
         
- // save the version info
+ // save the source mode and version info (only restored for 1.6+)
+ std::string source_mode = actions.source_mode;
         unsigned qbk_major_version_store = qbk_major_version;
         unsigned qbk_minor_version_store = qbk_minor_version;
         unsigned qbk_version_n_store = qbk_version_n;
@@ -1509,6 +1510,8 @@
         
         if(qbk_version_n >= 106 || qbk_version_n_store >= 106)
         {
+ actions.source_mode = source_mode;
+
             qbk_major_version = qbk_major_version_store;
             qbk_minor_version = qbk_minor_version_store;
             qbk_version_n = qbk_version_n_store;

Modified: trunk/tools/quickbook/src/doc_info_actions.cpp
==============================================================================
--- trunk/tools/quickbook/src/doc_info_actions.cpp (original)
+++ trunk/tools/quickbook/src/doc_info_actions.cpp 2011-03-19 06:47:02 EDT (Sat, 19 Mar 2011)
@@ -281,11 +281,14 @@
                 end = actions.doc_categories.end();
                 it != end; ++it)
             {
- tmp << " <" << actions.doc_type << "category name=\"category:"
- << it->get(106)
- << "\"></" << actions.doc_type << "category>\n"
- << "\n"
- ;
+ if (!it->empty())
+ {
+ tmp << " <" << actions.doc_type << "category name=\"category:"
+ << it->get(106)
+ << "\"></" << actions.doc_type << "category>\n"
+ << "\n"
+ ;
+ }
             }
         }
 

Modified: trunk/tools/quickbook/test/Jamfile.v2
==============================================================================
--- trunk/tools/quickbook/test/Jamfile.v2 (original)
+++ trunk/tools/quickbook/test/Jamfile.v2 2011-03-19 06:47:02 EDT (Sat, 19 Mar 2011)
@@ -11,6 +11,8 @@
         <toolset>msvc:<debug-symbols>off
     ;
 
+build-project doc-info ;
+
 import quickbook-testing : quickbook-test quickbook-fail-test ;
 
 test-suite quickbook.test :
@@ -49,10 +51,6 @@
     [ quickbook-test list_test ]
     [ quickbook-test cond_phrase ]
     [ quickbook-test macro ]
- [ quickbook-test doc-info-1 ]
- [ quickbook-test doc-info-2 ]
- [ quickbook-test doc-info-3 ]
- [ quickbook-test doc-info-4 ]
     [ quickbook-test callouts ]
     [ quickbook-test simple_markup ]
     [ quickbook-test xml-escape_1_2 ]

Deleted: trunk/tools/quickbook/test/doc-info-1.gold
==============================================================================
--- trunk/tools/quickbook/test/doc-info-1.gold 2011-03-19 06:47:02 EDT (Sat, 19 Mar 2011)
+++ (empty file)
@@ -1,24 +0,0 @@
-<?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="karel_vom_u00e1_u010dka_and_tom_u00e1_u0161_martin_u00edk" lang="en"
-last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude">
- <title>Karel Vom&#xE1;&#x10D;ka and Tom&#xE1;&#x161; Martin&#xED;k</title>
- <articleinfo>
- <authorgroup>
- <author>
- <firstname>Matti</firstname> <surname>Meik&#xE4;l&#xE4;inen</surname>
- </author>
- <author>
- <firstname>Pero</firstname> <surname>Peri&#x107;</surname>
- </author>
- </authorgroup>
- <copyright>
- <year>2010</year> <holder>Me&#xF0;al-J&#xF3;n and J&#xF3;na J&#xF3;nsd&#xF3;ttir</holder>
- </copyright>
- <articlepurpose>
- Inline code test: <code>1 + 2</code>
- </articlepurpose>
- <articlecategory name="category:tests"></articlecategory> <articlecategory name="category:irrelevance"></articlecategory>
- <biblioid class="uri">http://www.boost.org/tools/quickbook/test/doc-info-1.quickbook>
- </articleinfo>
-</article>

Deleted: trunk/tools/quickbook/test/doc-info-1.quickbook
==============================================================================
--- trunk/tools/quickbook/test/doc-info-1.quickbook 2011-03-19 06:47:02 EDT (Sat, 19 Mar 2011)
+++ (empty file)
@@ -1,12 +0,0 @@
-[article Karel Vom\u00E1\u010Dka and Tom\u00E1\u0161 Martin\u00EDk
-[quickbook 1.6]
-[authors [Meik\u00E4l\u00E4inen, Matti][Peri\u0107, Pero]]
-[copyright 2010 Me\u00F0al-J\u00F3n and J\u00F3na J\u00F3nsd\u00F3ttir]
-[source-mode teletype]
-[purpose Inline code test: `1 + 2`]
-[category tests]
-[category irrelevance]
-[/ [category commented out] ]
-[biblioid uri
http://www.boost.org/tools/quickbook/test/doc-info-1.quickbook]
-[lang en]
-]

Deleted: trunk/tools/quickbook/test/doc-info-2.gold
==============================================================================
--- trunk/tools/quickbook/test/doc-info-2.gold 2011-03-19 06:47:02 EDT (Sat, 19 Mar 2011)
+++ (empty file)
@@ -1,26 +0,0 @@
-<?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="karel_vom__xe1___x10d_ka_and_tom__xe1___x161__martin__xed_k" name="Karel Vom&#xE1;&#x10D;ka and Tom&#xE1;&#x161; Martin&#xED;k"
-dirname="karel_vom__xe1___x10d_ka_and_tom__xe1___x161__martin__xed_k" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $"
- xmlns:xi="http://www.w3.org/2001/XInclude">
- <libraryinfo>
- <authorgroup>
- <author>
- <firstname>Matti</firstname> <surname>Meik&#xE4;l&#xE4;inen</surname>
- </author>
- <author>
- <firstname>Pero</firstname> <surname>Peri&#x107;</surname>
- </author>
- </authorgroup>
- <copyright>
- <year>2010</year> <holder>Me&#xF0;al-J&#xF3;n and J&#xF3;na J&#xF3;nsd&#xF3;ttir</holder>
- </copyright>
- <librarypurpose>
- Inline code test: <code>1 + 2</code>
- </librarypurpose>
- <librarycategory name="category:tests"></librarycategory> <librarycategory name="category:irrelevance"></librarycategory>
- <biblioid class="uri">http://www.boost.org/tools/quickbook/test/doc-info-2.quickbook>
- <biblioid class="isbn">0-937383-18-X</biblioid>
- </libraryinfo>
- <title>Karel Vom&#xE1;&#x10D;ka and Tom&#xE1;&#x161; Martin&#xED;k</title>
-</library>

Deleted: trunk/tools/quickbook/test/doc-info-2.quickbook
==============================================================================
--- trunk/tools/quickbook/test/doc-info-2.quickbook 2011-03-19 06:47:02 EDT (Sat, 19 Mar 2011)
+++ (empty file)
@@ -1,14 +0,0 @@
-[library Karel Vom&#xE1;&#x10D;ka and Tom&#xE1;&#x161; Martin&#xED;k
-[quickbook 1.5]
-[authors [Meik&#xE4;l&#xE4;inen, Matti],[Peri&#x107;, Pero]]
-[copyright 2010 Me&#xF0;al-J&#xF3;n and J&#xF3;na J&#xF3;nsd&#xF3;ttir]
-[source-mode teletype]
-[purpose Inline code test: `1 + 2`]
-[category tests]
-[category irrelevance]
-[/ [category commented out] ]
-[biblioid uri
http://www.boost.org/tools/quickbook/test/doc-info-2.quickbook]
-[biblioid isbn 0-937383-18-X]
-]
-
-[/ Some comment]

Deleted: trunk/tools/quickbook/test/doc-info-3.gold
==============================================================================
--- trunk/tools/quickbook/test/doc-info-3.gold 2011-03-19 06:47:02 EDT (Sat, 19 Mar 2011)
+++ (empty file)
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE appendix PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
-<appendix id="document_information_4" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $"
- xmlns:xi="http://www.w3.org/2001/XInclude">
- <title>Document Information 4</title>
- <appendixinfo>
- <authorgroup>
- <author>
- <firstname>Joe</firstname> <surname>Blow</surname>
- </author>
- </authorgroup>
- </appendixinfo>
-</appendix>

Deleted: trunk/tools/quickbook/test/doc-info-3.quickbook
==============================================================================
--- trunk/tools/quickbook/test/doc-info-3.quickbook 2011-03-19 06:47:02 EDT (Sat, 19 Mar 2011)
+++ (empty file)
@@ -1,5 +0,0 @@
-[appendix Document Information 4
-[quickbook 1.5]
-[authors [Blow, Joe]]
-]
-[/ Some comment]
\ No newline at end of file

Deleted: trunk/tools/quickbook/test/doc-info-4.gold
==============================================================================
--- trunk/tools/quickbook/test/doc-info-4.gold 2011-03-19 06:47:02 EDT (Sat, 19 Mar 2011)
+++ (empty file)
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
-<chapter id="document_information_4" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $"
- xmlns:xi="http://www.w3.org/2001/XInclude">
- <title>Document Information 4</title>
- <chapterinfo>
- <authorgroup>
- <author>
- <firstname>Joe</firstname> <surname>Blow</surname>
- </author>
- <author>
- <firstname>Jane</firstname> <surname>Doe</surname>
- </author>
- <author>
- <firstname>John</firstname> <surname>Coe</surname>
- </author>
- </authorgroup>
- </chapterinfo>
-</chapter>

Deleted: trunk/tools/quickbook/test/doc-info-4.quickbook
==============================================================================
--- trunk/tools/quickbook/test/doc-info-4.quickbook 2011-03-19 06:47:02 EDT (Sat, 19 Mar 2011)
+++ (empty file)
@@ -1,4 +0,0 @@
-[chapter Document Information 4
-[quickbook 1.5]
-[authors [Blow, Joe], [Doe, Jane] [Coe, John]]
-]
\ No newline at end of file


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