def epub_2_to_3(container, report, previous_nav=None): upgrade_metadata(container.opf) collect_properties(container) toc = get_toc(container) toc_name = find_existing_ncx_toc(container) if toc_name: container.remove_item(toc_name) container.opf_xpath('./opf:spine')[0].attrib.pop('toc', None) landmarks = get_landmarks(container) for guide in container.opf_xpath('./opf:guide'): guide.getparent().remove(guide) create_nav(container, toc, landmarks, previous_nav) container.opf.set('version', '3.0') fix_font_mime_types(container) container.dirty(container.opf_name)
def epub_2_to_3(container, report, previous_nav=None): upgrade_metadata(container.opf) collect_properties(container) toc = get_toc(container) toc_name = find_existing_ncx_toc(container) if toc_name: container.remove_item(toc_name) container.opf_xpath('./opf:spine')[0].attrib.pop('toc', None) landmarks = get_landmarks(container) for guide in container.opf_xpath('./opf:guide'): guide.getparent().remove(guide) create_nav(container, toc, landmarks, previous_nav) container.opf.set('version', '3.0') fix_font_mime_types(container) container.dirty(container.opf_name)