Permalink
Browse files

Improve \par & parameterlist output

Previously we were outputting these section as a field list which looked
rather good but it adds complications, specifically as docutils
automatically adds a ":" (thought perhaps we can suppress that?) but
more importantly a look at the doxygen html output that they treat these
as definition lists which is much easier to handle.

So we switch over to definition lists and make the term bold as doxygen
does and otherwise try to make sure it matches the doxygen output quite
well.
  • Loading branch information...
1 parent e3ec780 commit 839cae19ed7c3c50fff343b053dfa5d0ad100dc1 @michaeljones michaeljones committed May 31, 2012
Showing with 30 additions and 20 deletions.
  1. +19 −19 breathe/renderer/rst/doxygen/compound.py
  2. +11 −1 examples/specific/alias.h
@@ -498,18 +498,18 @@ def render(self):
renderer = self.renderer_factory.create_renderer(self.data_object, item)
nodelist.extend(renderer.render())
- field_nodes = []
- for entry in self.data_object.parameterlist: # Parameters/Exceptions
- renderer = self.renderer_factory.create_renderer(self.data_object, entry)
- field_nodes.extend(renderer.render())
-
- for item in self.data_object.simplesects: # Returns
+ definition_nodes = []
+ for item in self.data_object.simplesects: # Returns, user par's, etc
renderer = self.renderer_factory.create_renderer(self.data_object, item)
- field_nodes.extend(renderer.render())
+ definition_nodes.extend(renderer.render())
- if field_nodes:
- field_list = self.node_factory.field_list("", *field_nodes)
- nodelist.append(field_list)
+ for entry in self.data_object.parameterlist: # Parameters/Exceptions
+ renderer = self.renderer_factory.create_renderer(self.data_object, entry)
+ definition_nodes.extend(renderer.render())
+
+ if definition_nodes:
+ definition_list = self.node_factory.definition_list("", *definition_nodes)
+ nodelist.append(definition_list)
return [self.node_factory.paragraph("", "", *nodelist)]
@@ -557,11 +557,11 @@ def render(self):
# Fild list entry
nodelist_list = self.node_factory.bullet_list("", classes=["breatheparameterlist"], *nodelist)
- field_name = self.lookup[self.data_object.kind]
- field_name = self.node_factory.field_name("", field_name)
- field_body = self.node_factory.field_body('', nodelist_list)
+ term_text = self.lookup[self.data_object.kind]
+ term = self.node_factory.term("", "", self.node_factory.strong( "", term_text ) )
+ definition = self.node_factory.definition('', nodelist_list)
- return [self.node_factory.field('', field_name, field_body)]
+ return [self.node_factory.definition_list_item('', term, definition)]
@@ -624,7 +624,7 @@ def title(self):
text = self.node_factory.Text(self.data_object.kind.capitalize())
- return [text]
+ return [self.node_factory.strong( "", text )]
def render(self):
@@ -633,10 +633,10 @@ def render(self):
renderer = self.renderer_factory.create_renderer(self.data_object, item)
nodelist.append(self.node_factory.paragraph("", "", *renderer.render()))
- field_name = self.node_factory.field_name("", *self.title())
- field_body = self.node_factory.field_body("", *nodelist)
+ term = self.node_factory.term("", "", *self.title())
+ definition = self.node_factory.definition("", *nodelist)
- return [self.node_factory.field("", field_name, field_body)]
+ return [self.node_factory.definition_list_item("", term, definition)]
class ParDocSimpleSectTypeSubRenderer(DocSimpleSectTypeSubRenderer):
@@ -645,7 +645,7 @@ def title(self):
renderer = self.renderer_factory.create_renderer(self.data_object, self.data_object.title)
- return renderer.render()
+ return [self.node_factory.strong( "", *renderer.render() )]
class DocTitleTypeSubRenderer(Renderer):
@@ -1,7 +1,17 @@
+/*! @file */
+
/**
* Foo frob routine.
+ * \par bob this something else
+ * @sideeffect Frobs any foos.
+ * @return Frobs any foos.
+ *
+ * \par bob this something else
+ *
* @sideeffect Frobs any foos.
+ *
+ * @param Frobs any foos.
*/
-void frob_foos(void);
+void frob_foos(void* Frobs);

0 comments on commit 839cae1

Please sign in to comment.