- output('</book>\n')
-
- def section(self, doc, level, output):
- output('\n<sect%s>\n' % (level + 1))
- children=doc.getChildNodes()
- for c in children:
- getattr(self, self.element_types[c.getNodeName()])(c, level+1, output)
- output('\n</sect%s>\n' % (level + 1))
-
- def sectionTitle(self, doc, level, output):
- output('<title>')
- for c in doc.getChildNodes():
- getattr(self, self.element_types[c.getNodeName()])(c, level, output)
- output('</title>\n')
-
- def description(self, doc, level, output):
- p=doc.getPreviousSibling()
- if p is None or p.getNodeName() is not doc.getNodeName():
- output('<variablelist>\n')
- for c in doc.getChildNodes():
- getattr(self, self.element_types[c.getNodeName()])(c, level, output)
- n=doc.getNextSibling()
- if n is None or n.getNodeName() is not doc.getNodeName():
- output('</variablelist>\n')
-
- def descriptionTitle(self, doc, level, output):
- output('<varlistentry><term>\n')
- for c in doc.getChildNodes():
- getattr(self, self.element_types[c.getNodeName()])(c, level, output)
- output('</term>\n')
-
- def descriptionBody(self, doc, level, output):
- output('<listitem><para>\n')
- for c in doc.getChildNodes():
- getattr(self, self.element_types[c.getNodeName()])(c, level, output)
- output('</para></listitem>\n')
- output('</varlistentry>\n')
+ except:
+ print "failed", c.getNodeName(), c
+ output('</title>\n')
+
+ def description(self, doc, level, output):
+ p=doc.getPreviousSibling()
+ if p is None or p.getNodeName() is not doc.getNodeName():
+ output('<variablelist>\n')
+ for c in doc.getChildNodes():
+ getattr(self, self.element_types[c.getNodeName()])(c, level, output)
+ n=doc.getNextSibling()
+ if n is None or n.getNodeName() is not doc.getNodeName():
+ output('</variablelist>\n')
+
+ def descriptionTitle(self, doc, level, output):
+ output('<varlistentry><term>\n')
+ for c in doc.getChildNodes():
+ getattr(self, self.element_types[c.getNodeName()])(c, level, output)
+ output('</term>\n')
+
+ def descriptionBody(self, doc, level, output):
+ output('<listitem><para>\n')
+ for c in doc.getChildNodes():
+ getattr(self, self.element_types[c.getNodeName()])(c, level, output)
+ output('</para></listitem>\n')
+ output('</varlistentry>\n')
+
+ def bullet(self, doc, level, output):
+ p=doc.getPreviousSibling()
+ if p is None or p.getNodeName() is not doc.getNodeName():
+ output('<itemizedlist>\n')
+ output('<listitem><para>\n')
+
+ for c in doc.getChildNodes():
+ getattr(self, self.element_types[c.getNodeName()])(c, level, output)
+ n=doc.getNextSibling()
+ output('</para></listitem>\n')
+ if n is None or n.getNodeName() is not doc.getNodeName():
+ output('</itemizedlist>\n')
+
+ def numbered(self, doc, level, output):
+ p=doc.getPreviousSibling()
+ if p is None or p.getNodeName() is not doc.getNodeName():
+ output('<orderedlist>\n')
+ output('<listitem><para>\n')
+ for c in doc.getChildNodes():
+ getattr(self, self.element_types[c.getNodeName()])(c, level, output)
+ n=doc.getNextSibling()
+ output('</para></listitem>\n')
+ if n is None or n.getNodeName() is not doc.getNodeName():
+ output('</orderedlist>\n')
+
+ def example(self, doc, level, output):
+ i=0
+ for c in doc.getChildNodes():
+ if i==0:
+ output('<programlisting>\n<![CDATA[\n')
+ ##
+ ## eek. A ']]>' in your body will break this...
+ ##
+ output(prestrip(c.getNodeValue()))
+ output('\n]]></programlisting>\n')
+ else:
+ getattr(self, self.element_types[c.getNodeName()])(
+ c, level, output)
+
+ def paragraph(self, doc, level, output):
+ output('<para>\n\n')
+ for c in doc.getChildNodes():
+ getattr(self, self.element_types[c.getNodeName()])(
+ c, level, output)
+ output('</para>\n\n')
+
+ def link(self, doc, level, output):
+ output('<ulink url="%s">' % doc.href)
+ for c in doc.getChildNodes():
+ getattr(self, self.element_types[c.getNodeName()])(c, level, output)
+ output('</ulink>')