Input and compilation/EPUB

Unofficial ConTeXt Wiki mirror

Last modified: 2025-01-12


TODO: This page is work in progress and an update to the current pages Input and compilation/EPUB/OLD Epub and Input and compilation/EPUB/OLD Epub Sample. (See: To-Do List)

< XML | Export | Old ePub docs | Old ePub Sample >

The ePub facilities of ConTeXt are based on its Export of XML/XHTML. Make sure you get useful export output from your project before you try ePub.

Documentation about ePub

Minimal ePub

If you already ran ConTeXt on your project and got the file structure as described in Export, you can run mtxrun --script epub --make minimal to get a structure like:

minimal.epub
minimal-epub
├── META-INF
│   └── container.xml
├── OEBPS
│   ├── cover.xhtml
│   ├── images
│   ├── minimal-div.html
│   ├── minimal.opf
│   ├── nav.xhtml
│   ├── styles
│   │   ├── minimal-defaults.css
│   │   ├── minimal-fonts.css
│   │   ├── minimal-images.css
│   │   └── minimal-styles.css
│   └── toc.ncx
└── mimetype

Compressing the structure

The file structure outlined above gets packaged into a ZIP archive with the .epub extension.

   EPUB=minimal.epub
   zip -u9X  $EPUB mimetype
   zip -u9X  $EPUB META-INF/container.xml
   zip -u9rX $EPUB OEBPS -x OEBPS/.DS_Store OEBPS/Text/.DS_Store OEBPS/Images/.DS_Store "*/.DS_Store" "OEBPS/Images/*.pdf"

TODO

Write about