mark2epub is a simple Python script for converting Markdown files, images, and css files to a single ePub book.
mark2epub requires:
- Python (>= 3.4)
- markdown (>= 3.1)
The syntax for mark2epub is the following:
$ python md2epub.py <markdown_directory> <output_file.epub>
The directory epub_md
is a sample markdown directory for mark2epub.
Note that the directory markdown_directory
must contain
-
Markdown
.md
files. Each file represent a chapter in the resulting ePub. They are processed by name order, and will appear correspondingly in the e-book. -
An
images
folder, containing the images to be included. Only GIF (.gif
extension), JPEG (.jpg
or.jpeg
extensions), and PNG (.png
extension) files are currently supported. This folder is not processed recursively, so all images should be placed at the root of this folder. -
A
css
folder, containing the CSS files. This folder is not processed recursively, so all css files should be placed at the root of this folder. -
A
description.json
containing meta-information about the e-book. The keycover_image
should indicate the name of the cover image. The keydefault_css
is a list of css file names that are applied by default on all chapters. The keychapters
is a list of dictionaries, each one containing a keymarkdown
indicating the name of the corresponding markdown file, and a keycss
indicating the name of the css file that should be applied specifically to this chapter. See the example in the repository for a typicaldescription.json
file.
- Robustness checks in the
mark2epub.py
script - Recursive processing of the
images
andcss
folders - Support for additional fonts
- Support for mathematical notation