- def start_element(self, tag, attrib):
- self.cursors[self.current_cursors[-1]] = etree.SubElement(
- self.cursors[self.current_cursors[-1]],
+ def postprocess(self, document):
+ _ = document.tree.getroot().master.gettext
+
+ if document.meta.translators:
+ self.enter_fragment('header')
+ self.start_element('span', {'class': 'translator'})
+ self.push_text(_("translated by") + " ")
+ self.push_text(
+ ", ".join(
+ translator.readable()
+ for translator in document.meta.translators
+ )
+ )
+ self.exit_fragment()
+
+ add_anchors(self.tree)
+ if len(self.nota_red):
+ self.tree.append(self.nota_red)
+ add_table_of_themes(self.tree)
+ add_table_of_contents(self.tree)
+
+ if self.footnote_counter:
+ fnheader = etree.Element("h3")
+ fnheader.text = _("Footnotes")
+ self.footnotes.insert(0, fnheader)
+ self.tree.append(self.footnotes)
+
+ def start_element(self, tag, attrib=None):
+ self.cursor = etree.SubElement(
+ self.cursor,