rel
[librarian.git] / src / librarian / epub.py
index a8c6680..35766b8 100644 (file)
@@ -327,6 +327,18 @@ def transform_chunk(chunk_xml, chunk_no, annotations, empty=False,
                 )
             )
         elif element.tag in ('naglowek_podrozdzial', 'naglowek_scena'):
+            if not toc:
+                toc.append(
+                    (
+                        epub.Link(
+                            "part%d.xhtml" % chunk_no,
+                            " ",
+                            "part%d" % chunk_no
+                        ),
+                        []
+                    )
+                )
+
             subnumber = len(toc[-1][1])
             toc[-1][1].append(
                 epub.Link(
@@ -553,7 +565,7 @@ def transform(wldoc, verbose=False, style=None,
 
     spine = output.spine
 
-    functions.reg_mathml_epub(zip)
+    functions.reg_mathml_epub(output)
 
     if os.path.isdir(ilustr_path):
         ilustr_elements = set(ilustr.get('src')