+ def handle_nazwa_utworu(self, element):
+ toc = []
+ for naglowek in element.getparent().findall('.//naglowek_rozdzial'):
+ a = etree.Element("a")
+ a.attrib["href"] = "#" + naglowek.text
+ a.text = naglowek.text
+ atxt = etree.tostring(a, encoding=unicode)
+ toc.append("<li>%s</li>" % atxt)
+ toc = "<ul class='toc'>%s</ul>" % "".join(toc)
+ add_header = "Lekcja: " if self.options['wldoc'].book_info.type in ('course', 'synthetic') else ''
+ return "<h1 class='title'>%s" % add_header, "</h1>" + toc
+
+ @tagged("h2")
+ def handle_naglowek_rozdzial(self, element):
+ return "", "".join(tag_open_close("a", name=element.text))
+