Giter VIP home page Giter VIP logo

mark2epub's Introduction

mark2epub

mark2epub is a simple Python script for converting Markdown files, images, and css files to a single ePub book.

Installation and use

Dependencies

mark2epub requires:

  • Python (>= 3.4)
  • markdown (>= 3.1)

Running mark2epub

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 key cover_image should indicate the name of the cover image. The key default_css is a list of css file names that are applied by default on all chapters. The key chapters is a list of dictionaries, each one containing a key markdown indicating the name of the corresponding markdown file, and a key css indicating the name of the css file that should be applied specifically to this chapter. See the example in the repository for a typical description.json file.

Limitations/Features to be addressed

  • Robustness checks in the mark2epub.py script
  • Recursive processing of the images and css folders
  • Support for additional fonts
  • Support for mathematical notation

mark2epub's People

Contributors

alexpof avatar sjoblomj avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.