$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r53020 - in trunk/tools/quickbook: detail test
From: daniel_james_at_[hidden]
Date: 2009-05-15 02:13:00
Author: danieljames
Date: 2009-05-15 02:12:59 EDT (Fri, 15 May 2009)
New Revision: 53020
URL: http://svn.boost.org/trac/boost/changeset/53020
Log:
Use the correct source type for snippets.
Added:
   trunk/tools/quickbook/test/stub.c   (contents, props changed)
   trunk/tools/quickbook/test/stub.py   (contents, props changed)
Text files modified: 
   trunk/tools/quickbook/detail/actions.cpp    |     8 ++++-                                   
   trunk/tools/quickbook/test/import.gold      |    56 ++++++++++++++++++++++++++++++++++++++++
   trunk/tools/quickbook/test/import.quickbook |     6 ++++                                    
   3 files changed, 68 insertions(+), 2 deletions(-)
Modified: trunk/tools/quickbook/detail/actions.cpp
==============================================================================
--- trunk/tools/quickbook/detail/actions.cpp	(original)
+++ trunk/tools/quickbook/detail/actions.cpp	2009-05-15 02:12:59 EDT (Fri, 15 May 2009)
@@ -1010,7 +1010,9 @@
             detail::unindent(code); // remove all indents
             if (code.size() != 0)
             {
-                snippet += "\n\n``\n" + code + "``\n\n";
+                snippet += "\n\n";
+                snippet += is_python ? "[python]" : "[c++]";
+                snippet += "``\n" + code + "``\n\n";
                 code.clear();
             }
         }
@@ -1030,7 +1032,9 @@
             detail::unindent(code); // remove all indents
             if (code.size() != 0)
             {
-                snippet += "\n\n```\n" + code + "```\n\n";
+                snippet += "\n\n";
+                snippet += is_python ? "[python]" : "[c++]";
+                snippet += "```\n" + code + "```\n\n";
             }
 
             if(callouts.size() > 0)
Modified: trunk/tools/quickbook/test/import.gold
==============================================================================
--- trunk/tools/quickbook/test/import.gold	(original)
+++ trunk/tools/quickbook/test/import.gold	2009-05-15 02:12:59 EDT (Fri, 15 May 2009)
@@ -32,4 +32,60 @@
 </programlisting>
     </para>
   </para>
+  <para>
+    <para>
+      This is the Python <emphasis role="bold"><emphasis>foo</emphasis></emphasis>
+      function.
+    </para>
+    <para>
+      This description can have paragraphs...
+    </para>
+    <itemizedlist>
+      <listitem>
+        lists
+      </listitem>
+      <listitem>
+        etc.
+      </listitem>
+    </itemizedlist>
+    <para>
+      And any quickbook block markup.
+    </para>
+    <para>
+      
+<programlisting><phrase role="keyword">def</phrase> <phrase role="identifier">foo</phrase><phrase role="special">():</phrase>
+    <phrase role="comment"># return 'em, foo man!
+</phrase>    <phrase role="keyword">return</phrase> <phrase role="string">"foo"</phrase>
+
+</programlisting>
+    </para>
+  </para>
+  <para>
+    <para>
+      This is the C <emphasis role="bold"><emphasis>foo</emphasis></emphasis> function.
+    </para>
+    <para>
+      This description can have paragraphs...
+    </para>
+    <itemizedlist>
+      <listitem>
+        lists
+      </listitem>
+      <listitem>
+        etc.
+      </listitem>
+    </itemizedlist>
+    <para>
+      And any quickbook block markup.
+    </para>
+    <para>
+      
+<programlisting><phrase role="keyword">char</phrase><phrase role="special">*</phrase> <phrase role="identifier">foo</phrase><phrase role="special">()</phrase>
+<phrase role="special">{</phrase>
+    <phrase role="comment">// return 'em, foo man!
+</phrase>    <phrase role="keyword">return</phrase> <phrase role="string">"foo"</phrase><phrase role="special">;</phrase>
+<phrase role="special">}</phrase>
+</programlisting>
+    </para>
+  </para>
 </article>
Modified: trunk/tools/quickbook/test/import.quickbook
==============================================================================
--- trunk/tools/quickbook/test/import.quickbook	(original)
+++ trunk/tools/quickbook/test/import.quickbook	2009-05-15 02:12:59 EDT (Fri, 15 May 2009)
@@ -1,6 +1,12 @@
 [article Import]
 
+[import stub.c]
+[import stub.py]
 [import stub.cpp]
 
 [foo]
 
+[foo_py]
+
+[foo_c]
+
Added: trunk/tools/quickbook/test/stub.c
==============================================================================
--- (empty file)
+++ trunk/tools/quickbook/test/stub.c	2009-05-15 02:12:59 EDT (Fri, 15 May 2009)
@@ -0,0 +1,26 @@
+/*=============================================================================
+    Copyright (c) 2006 Joel de Guzman
+    http://spirit.sourceforge.net/
+
+    Use, modification and distribution is subject to the Boost Software
+    License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+    http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================*/
+
+/*[foo_c */
+    /*`
+    This is the C [*['foo]] function.
+
+    This description can have paragraphs...
+
+    * lists
+    * etc.
+
+    And any quickbook block markup.
+    */
+char* foo()
+{
+    // return 'em, foo man!
+    return "foo";
+}
+/*]*/
Added: trunk/tools/quickbook/test/stub.py
==============================================================================
--- (empty file)
+++ trunk/tools/quickbook/test/stub.py	2009-05-15 02:12:59 EDT (Fri, 15 May 2009)
@@ -0,0 +1,25 @@
+# Copyright 2009 Daniel James
+#
+# Use, modification and distribution is subject to the Boost Software
+# License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+
+#[foo_py
+"""`
+    This is the Python [*['foo]] function.
+
+    This description can have paragraphs...
+
+    * lists
+    * etc.
+
+    And any quickbook block markup.
+"""
+
+def foo():
+    # return 'em, foo man!
+    return "foo"
+
+#]
+
+print foo()
\ No newline at end of file