' % self.handle_attrs(layout))
self.format_children(layout)
self.writeln('
')
self.section -= 1
def visit_title(self, layout):
"""display a title using """
self.write('' % (self.section, self.handle_attrs(layout)))
self.format_children(layout)
self.writeln('' % self.section)
def visit_table(self, layout):
"""display a table as html"""
self.writeln('' % self.handle_attrs(layout))
table_content = self.get_table_content(layout)
for i in range(len(table_content)):
row = table_content[i]
if i == 0 and layout.rheaders:
self.writeln('' % (i%2 and 'even' or 'odd'))
for j in range(len(row)):
cell = row[j] or ' '
if (layout.rheaders and i == 0) or \
(layout.cheaders and j == 0) or \
(layout.rrheaders and i+1 == len(table_content)) or \
(layout.rcheaders and j+1 == len(row)):
self.writeln('%s | ' % cell)
else:
self.writeln('%s | ' % cell)
self.writeln('
')
self.writeln('
')
def visit_list(self, layout):
"""display a list as html"""
self.writeln('' % self.handle_attrs(layout))
for row in list(self.compute_content(layout)):
self.writeln('- %s
' % row)
self.writeln('
')
def visit_paragraph(self, layout):
"""display links (using )"""
self.write('
')
self.format_children(layout)
self.write('
')
def visit_span(self, layout):
"""display links (using )"""
self.write('' % self.handle_attrs(layout))
self.format_children(layout)
self.write('')
def visit_link(self, layout):
"""display links (using )"""
self.write(' %s' % (layout.url,
self.handle_attrs(layout),
layout.label))
def visit_verbatimtext(self, layout):
"""display verbatim text (using
)"""
self.write('')
self.write(layout.data.replace('&', '&').replace('<', '<'))
self.write('
')
def visit_text(self, layout):
"""add some text"""
data = layout.data
if layout.escaped:
data = data.replace('&', '&').replace('<', '<')
self.write(data)