[gobject-introspection/wip/transformer] Implement property details



commit 67036459304ceab28a9179cd0b0b0c92f7350706
Author: Zachary Goldberg <zgoldberg src gnome org>
Date:   Thu Jul 29 06:06:53 2010 -0400

    Implement property details

 giscanner/gicodeformatters.py |    3 +--
 giscanner/gidocgen.py         |   31 +++++++++++++++++++++++--------
 2 files changed, 24 insertions(+), 10 deletions(-)
---
diff --git a/giscanner/gicodeformatters.py b/giscanner/gicodeformatters.py
index ac848f2..dc6c3a8 100644
--- a/giscanner/gicodeformatters.py
+++ b/giscanner/gicodeformatters.py
@@ -51,8 +51,7 @@ class DocBookFormatter(object):
                 ("linkend", 
                  clazz.render_typelinkname(prop.type,
                                            prop.namespace.name))],
-                         clazz.get_type_string(
-                prop.type))
+                         clazz.get_type_string(prop.type))
         writer.write_line("%s: " % space(
                 25 - len(clazz.get_type_string(prop.type))))
                 
diff --git a/giscanner/gidocgen.py b/giscanner/gidocgen.py
index 5e05cb0..6c4af43 100644
--- a/giscanner/gidocgen.py
+++ b/giscanner/gidocgen.py
@@ -145,11 +145,9 @@ class DocBookWriter(DocWriter):
             entity.get_type(),
             formatter.name)
 
-        # Stupid hack to get links to work.   This refsect1 
+        # Stupid hack to get links to work.   This anchor
         # should not be here.
-        self.writer.push_tag('refsect1', 
-                             [('id', func_id),
-                              ('role', 'function')])
+        self.writer.write_tag('anchor', [('id', func_id)])
         self.writer.push_tag('refsect2', 
                              [('id', func_id),
                               ('role', 'function')])
@@ -164,7 +162,6 @@ class DocBookWriter(DocWriter):
         formatter.render(self.writer, entity)    
 
         self.writer.pop_tag()
-        self.writer.pop_tag()
                 
 
     def __render_synopsis(self, page, formatter):
@@ -309,11 +306,29 @@ class DocBookWriter(DocWriter):
                                      ("role", "details")]):
 
             self.writer.write_tag("title", [("role", "properties.title")],
-                                  "Properties")
+                                  "Property Details")
             
             for entity in page.get_entities("property"):
-                self._render_entity(entity, formatter)
-            
+                prop_id = "%s%s-%s-%s" % (                        
+                    entity.get_data().parent_class.name,
+                    entity.get_data().name,
+                    "property",
+                    formatter.name
+                    )
+                # Again, terrible hack to make links work
+                self.writer.write_tag('anchor', [('id', prop_id)])
+                with self.writer.tagcontext('refsect2',
+                                            [('id', prop_id)]):
+                    with self.writer.tagcontext("indexterm",
+                                                [("zone", "%s" % prop_id)]):
+                        self.writer.write_tag("primary", [], prop_id)
+
+                    self.writer.push_tag("programlisting")
+                    self.writer.disable_whitespace()
+                    formatter.render(self.writer, entity)
+                    self.writer.enable_whitespace()
+                    self.writer.pop_tag()
+                    self.writer.write_tag("para", [], entity.get_data().doc)
 
             
     def _render_page(self, page, formatter):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]