def to_rst(self): """ Return the rst representation of this tag and it's children. """ child_rst = u"".join([child.to_rst() for child in self.children]) rst = ".. %s::\n" % (self.directive) return rst + text.indent(child_rst, 3)
def to_rst(self): """ Return the rst representation of this tag and its children. """ trs = self.find('tr') columns = [child.to_rst() for child in trs[0].children] rows = [[child.to_rst() for child in tr.children] for tr in trs[1:]] output = table.create_table(columns,rows) caption_nodes = self.find('caption') if len(caption_nodes) > 0: caption_text = caption_nodes[0].to_rst() output = ".. table:: " + caption_text + "\n\n" + text.indent(output) return output
def to_rst(self): """ Return the rst representation of this tag and its children. """ trs = self.find('tr') columns = [child.to_rst() for child in trs[0].children] rows = [[child.to_rst() for child in tr.children] for tr in trs[1:]] output = table.create_table(columns, rows) caption_nodes = self.find('caption') if len(caption_nodes) > 0: caption_text = caption_nodes[0].to_rst() output = ".. table:: " + caption_text + "\n\n" + text.indent( output) return output
def to_rst(self): """ Return the rst representation of this tag and it's children. """ child_rst = " ".join([child.to_rst() for child in self.children]) return ".. note::\n" + text.indent(child_rst, 3)
def to_rst(self): symbol = self.list_symbol() items = [text.indent(child.to_rst(), 3) for child in self.children] items = [item.rstrip() for item in items] items = [symbol + item[2:] + "\n" for item in items] return u"\n\n" + u"".join(items) + u"\n\n"
def to_rst(self): """ Return the rst representation of this tag and it's children. """ return ".. code::\n\n" + text.indent(self.attributes['text'], 3) + "\n"