mallardwriter: Use the same code to lookup fundamentals as the rest
authorJasper St. Pierre <jstpierre@mecheye.net>
Wed, 30 Jan 2013 14:50:43 +0000 (09:50 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Sat, 2 Feb 2013 00:47:40 +0000 (19:47 -0500)
Also, put <code> blocks around fundamentals.

giscanner/mallardwriter.py
tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.method.page
tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.static_method.page
tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page
tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.static_method.page

index c4c88e94bf48dff018178ceceb9b9906050afb24..74bb3d67b335a356520732210a32c638d1c0ad9a 100644 (file)
@@ -239,7 +239,11 @@ class MallardFormatter(object):
         return self.format_xref(type_)
 
     def _process_fundamental(self, node, match, props):
-        return self.fundamentals.get(props['fundamental'], match)
+        fundamental = props['fundamental']
+        try:
+            return '<code>%s</code>' % (self.fundamentals[fundamental],)
+        except KeyError:
+            return match
 
     def _process_parameter(self, node, match, props):
         try:
index 38e4f5a55ce42f798472be5bb7edc02eb54671bd..1c52955e6cc3cde074d3298c46a513ae6404788e 100644 (file)
@@ -62,11 +62,11 @@ created with <link xref="DocExamples.Obj.new">doc_examples_obj_new</link>.</p><p
 </tr>
 <tr>
 <td><p>boolean_arg :</p></td>
-<td><p>You should always pass TRUE.</p></td>
+<td><p>You should always pass <code>TRUE</code>.</p></td>
 </tr>
 <tr>
 <td><p>pointer_arg :</p></td>
-<td><p>If not NULL, do a thing. Pass <code>first_arg</code> if you want to sometimes. You can also pass <code>second_arg</code>, or even <code>boolean_arg</code>.</p></td>
+<td><p>If not <code>NULL</code>, do a thing. Pass <code>first_arg</code> if you want to sometimes. You can also pass <code>second_arg</code>, or even <code>boolean_arg</code>.</p></td>
 </tr>
 <tr>
 <td><p>string :</p></td>
@@ -74,7 +74,7 @@ created with <link xref="DocExamples.Obj.new">doc_examples_obj_new</link>.</p><p
 </tr>
 <tr>
 <td><p>Returns :</p></td>
-<td><p>Either FALSE or something FALSE-y.</p></td>
+<td><p>Either <code>FALSE</code> or something <code>FALSE</code>-y.</p></td>
 </tr>
 </table>
 <p>Since 0.99</p>
index f5f2145bbfb39e8181b8b4171c1e57178b178b49..f0c917f58d932c98767b07db6cd8d32e25fb8d25 100644 (file)
@@ -29,11 +29,11 @@ and a return value.</p>
 <table>
 <tr>
 <td><p>out_arg :</p></td>
-<td><p>a pointer to int, or NULL to ignore</p></td>
+<td><p>a pointer to int, or <code>NULL</code> to ignore</p></td>
 </tr>
 <tr>
 <td><p>Returns :</p></td>
-<td><p>TRUE if <code>out_arg</code> is valid, FALSE otherwise</p></td>
+<td><p><code>TRUE</code> if <code>out_arg</code> is valid, <code>FALSE</code> otherwise</p></td>
 </tr>
 </table>
 </page>
index cd80570865b74790ddbcfdaeff2c8f34f0f2cfea..3f51bf32e91b9ef1030702bf232333af6abfbe95 100644 (file)
@@ -60,11 +60,11 @@ created with <link xref="DocExamples.Obj.new">Obj.new</link>.</p><p>This should
 </tr>
 <tr>
 <td><p>boolean_arg :</p></td>
-<td><p>You should always pass True.</p></td>
+<td><p>You should always pass <code>True</code>.</p></td>
 </tr>
 <tr>
 <td><p>pointer_arg :</p></td>
-<td><p>If not None, do a thing. Pass <code>self</code> if you want to sometimes. You can also pass <code>second_arg</code>, or even <code>boolean_arg</code>.</p></td>
+<td><p>If not <code>None</code>, do a thing. Pass <code>self</code> if you want to sometimes. You can also pass <code>second_arg</code>, or even <code>boolean_arg</code>.</p></td>
 </tr>
 <tr>
 <td><p>string :</p></td>
@@ -72,7 +72,7 @@ created with <link xref="DocExamples.Obj.new">Obj.new</link>.</p><p>This should
 </tr>
 <tr>
 <td><p>Returns :</p></td>
-<td><p>Either False or something False-y.</p></td>
+<td><p>Either <code>False</code> or something <code>False</code>-y.</p></td>
 </tr>
 </table>
 <p>Since 0.99</p>
index 35c6c7b9abe61444ff824eec210d8eff8b0299a8..2577eb89bfd64b4e4d525613d0fc11c3873364d9 100644 (file)
@@ -32,11 +32,11 @@ and a return value.</p>
 <table>
 <tr>
 <td><p>out_arg :</p></td>
-<td><p>a pointer to int, or None to ignore</p></td>
+<td><p>a pointer to int, or <code>None</code> to ignore</p></td>
 </tr>
 <tr>
 <td><p>Returns :</p></td>
-<td><p>True if <code>out_arg</code> is valid, False otherwise</p></td>
+<td><p><code>True</code> if <code>out_arg</code> is valid, <code>False</code> otherwise</p></td>
 </tr>
 </table>
 </page>