doc.automaticstyles.addElement(s) s = Style(name="AutoWidth", family="table-column") s.addElement(TableColumnProperties(useoptimalcolumnwidth = "true")) doc.automaticstyles.addElement(s) s = Style(name="NameWidth", family="table-column") s.addElement(TableColumnProperties(columnwidth="1cm")) doc.automaticstyles.addElement(s) s = Style(name="TableAutoWidth", family="table-column") s.addElement(TableColumnProperties(useoptimalcolumnwidth='true')) doc.styles.addElement(s) # TOC. toc = TableOfContent(name = 'toc') toc.addElement(TableOfContentSource(outlinelevel = '2', useindexmarks = 'false')) doc.text.addElement(toc) page_break(doc) # Introduction. h1(doc, 'Introduction') p(doc, root.find('doc').text) page_break(doc) # Argument types. h1(doc, 'Arguments Types') do_arg_types(doc, root.find('types')) page_break(doc) # Command structure.
doc.automaticstyles.addElement(s) s = Style(name="AutoWidth", family="table-column") s.addElement(TableColumnProperties(useoptimalcolumnwidth="true")) doc.automaticstyles.addElement(s) s = Style(name="NameWidth", family="table-column") s.addElement(TableColumnProperties(columnwidth="1cm")) doc.automaticstyles.addElement(s) s = Style(name="TableAutoWidth", family="table-column") s.addElement(TableColumnProperties(useoptimalcolumnwidth='true')) doc.styles.addElement(s) # TOC. toc = TableOfContent(name='toc') toc.addElement(TableOfContentSource(outlinelevel='2', useindexmarks='false')) doc.text.addElement(toc) page_break(doc) # Introduction. h1(doc, 'Introduction') p(doc, root.find('doc').text) page_break(doc) # Argument types. h1(doc, 'Arguments Types') do_arg_types(doc, root.find('types')) page_break(doc) # Command structure.
def add_toc(self, odt): # TOC tc = TableOfContent(name=_("Table of contents")) tcs = TableOfContentSource() tc.addElement(tcs) odt.text.addElement(tc)