7. Templates

Templates, i.e., “scaffold” XML/CSS content; these are finalized (usually parsed on the fly), and then added to the book, by the Package instance.

rp2epub.templates.meta_inf

XML code for the Manifest file

rp2epub.templates.NAV

XHTML code for the new type EPUB3 table of content file. The string has to be completed for styling on whether the TOC entries contain numbering or not

rp2epub.templates.NAV_CSS_NUMBERING

CSS complement to the NAV string that includes numbering

rp2epub.templates.NAV_CSS_NO_NUMBERING

CSS complement to the NAV string that relies on the numbers generated into the TOC entries and not done by CSS

rp2epub.templates.TOC

XML code for the old type EPUB2 table of content file (many EPUB readers still require this…)

rp2epub.templates.PACKAGE

XML code for the package file (opf file)

rp2epub.templates.COVER

XHTML code for the cover page

rp2epub.templates.BOOK_CSS

Main content of the book.css file, adding some page-breaking statements to the overall styling.

rp2epub.templates.BOOK_CSS_EXTRAS

Additional content of the book.css file, depending on the version of the style sheet (2015, 2016, etc)

Source code: utils.py