Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58040 - in trunk/tools/quickbook: detail test
From: daniel_james_at_[hidden]
Date: 2009-11-29 16:06:24


Author: danieljames
Date: 2009-11-29 16:06:23 EST (Sun, 29 Nov 2009)
New Revision: 58040
URL: http://svn.boost.org/trac/boost/changeset/58040

Log:
Add a newline after callout bodies, to avoid confusing the quickbook parser.
Added:
   trunk/tools/quickbook/test/callouts.cpp (contents, props changed)
   trunk/tools/quickbook/test/callouts.gold (contents, props changed)
   trunk/tools/quickbook/test/callouts.quickbook (contents, props changed)
Text files modified:
   trunk/tools/quickbook/detail/actions.cpp | 1 +
   trunk/tools/quickbook/test/Jamfile.v2 | 1 +
   2 files changed, 2 insertions(+), 0 deletions(-)

Modified: trunk/tools/quickbook/detail/actions.cpp
==============================================================================
--- trunk/tools/quickbook/detail/actions.cpp (original)
+++ trunk/tools/quickbook/detail/actions.cpp 2009-11-29 16:06:23 EST (Sun, 29 Nov 2009)
@@ -1212,6 +1212,7 @@
 
                   snippet += "'''<para>'''";
                   snippet += callouts[i];
+ snippet += "\n";
                   snippet += "'''</para>'''";
                   snippet += "'''</callout>'''";
               }

Modified: trunk/tools/quickbook/test/Jamfile.v2
==============================================================================
--- trunk/tools/quickbook/test/Jamfile.v2 (original)
+++ trunk/tools/quickbook/test/Jamfile.v2 2009-11-29 16:06:23 EST (Sun, 29 Nov 2009)
@@ -30,6 +30,7 @@
     [ quickbook-test heading ]
     [ quickbook-test table_1_5 ]
     [ quickbook-test image_1_5 ]
+ [ quickbook-test callouts ]
     [ quickbook-fail-test fail-include ]
     [ quickbook-fail-test fail-import ]
     [ quickbook-fail-test fail-template-arguments1 ]

Added: trunk/tools/quickbook/test/callouts.cpp
==============================================================================
--- (empty file)
+++ trunk/tools/quickbook/test/callouts.cpp 2009-11-29 16:06:23 EST (Sun, 29 Nov 2009)
@@ -0,0 +1,30 @@
+//[ example1
+
+/*`
+ Now we can define a function that simulates an ordinary
+ six-sided die.
+*/
+int roll_die() {
+ boost::uniform_int<> dist(1, 6); /*< create a uniform_int distribution >*/
+}
+
+//]
+
+//[ example2
+
+int roll_die() {
+ /*<< [important test] >>*/
+ boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist);
+}
+
+//]
+
+//[ example3
+
+int roll_die() {
+ /*<< [important test]
+ >>*/
+ boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist);
+}
+
+//]

Added: trunk/tools/quickbook/test/callouts.gold
==============================================================================
--- (empty file)
+++ trunk/tools/quickbook/test/callouts.gold 2009-11-29 16:06:23 EST (Sun, 29 Nov 2009)
@@ -0,0 +1,75 @@
+<?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">
+<article id="callout_tests" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
+ <title>Callout Tests</title>
+ <articleinfo>
+ </articleinfo>
+ <para>
+ Example 1:
+ </para>
+ <para>
+ <para>
+ Now we can define a function that simulates an ordinary six-sided die.
+ </para>
+ <para>
+
+<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">roll_die</phrase><phrase role="special">()</phrase> <phrase role="special">{</phrase>
+ <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--><phrase role="callout_bug"><co id="callout_tests0co" linkends="callout_tests0" /></phrase><!--quickbook-escape-postfix-->
+<phrase role="special">}</phrase>
+
+</programlisting>
+ </para>
+ <para>
+ <calloutlist><callout arearefs="callout_tests0co" id="callout_tests0"><para> create a uniform_int distribution </para></callout></calloutlist>
+ </para>
+ </para>
+ <para>
+ Example 2:
+ </para>
+ <para>
+ <para>
+
+<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">roll_die</phrase><phrase role="special">()</phrase> <phrase role="special">{</phrase>
+ <!--quickbook-escape-prefix--><phrase role="line_callout_bug"><co id="callout_tests1co" linkends="callout_tests1" /></phrase><!--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>
+<phrase role="special">}</phrase>
+
+</programlisting>
+ </para>
+ <para>
+ <calloutlist><callout arearefs="callout_tests1co" id="callout_tests1"><para>
+ </para>
+ <important>
+ <para>
+ test
+ </para>
+ </important>
+ <para>
+ </para></callout></calloutlist>
+ </para>
+ </para>
+ <para>
+ Example 3:
+ </para>
+ <para>
+ <para>
+
+<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">roll_die</phrase><phrase role="special">()</phrase> <phrase role="special">{</phrase>
+ <!--quickbook-escape-prefix--><phrase role="line_callout_bug"><co id="callout_tests2co" linkends="callout_tests2" /></phrase><!--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>
+<phrase role="special">}</phrase>
+
+</programlisting>
+ </para>
+ <para>
+ <calloutlist><callout arearefs="callout_tests2co" id="callout_tests2"><para>
+ </para>
+ <important>
+ <para>
+ test
+ </para>
+ </important>
+ <para>
+ </para></callout></calloutlist>
+ </para>
+ </para>
+</article>

Added: trunk/tools/quickbook/test/callouts.quickbook
==============================================================================
--- (empty file)
+++ trunk/tools/quickbook/test/callouts.quickbook 2009-11-29 16:06:23 EST (Sun, 29 Nov 2009)
@@ -0,0 +1,17 @@
+[article Callout Tests
+ [quickbook 1.5]
+]
+
+[import callouts.cpp]
+
+Example 1:
+
+[example1]
+
+Example 2:
+
+[example2]
+
+Example 3:
+
+[example3]


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