Coder Social home page Coder Social logo

ebookmaker's Introduction

ebookmaker

ebookmaker is a Python3 script that takes a JSON book description and a bunch of HTML files, and builds an eBook. The script generates the boring part of the eBook metadata, e.g. the index that appears both in contents.opf, toc.ncx, and in a HTML page.

The script depends on the beautifulsoup4 package.

To allow the script to generate the various tables of contents (content.opf, toc.ncx, and the HTML index; although this last one may be hand made, if you want) the HTML content must follow a couple of simple rules:

  • Use header tags consistently: <h1> for section/chapter, <h2> for subsection, <h3> for subsubsection.
  • Use the "id" attribute to identify the entry in the index.

Examples

In the future I'll document the JSON book description format, for now there are a couple of books in the examples directory. Enter the examples directory and run the script like this to build ePub files:

$ python3 ../../ebookmaker BOOK.json

Recipes

The 'recipes' directory is also interesting, there you'll find Python scripts that download content not available in ebook format, but as HTML, format it and calls on ebookmaker to assembly in a nice ebook.

Usage

ebookmaker [-h] [-o OUTPUT] ebookData

positional arguments:

ebookData             JSON file containing the ebook information.

optional arguments:

-h, --help            show this help message and exit
-o OUTPUT,            Name of the output file.
--output OUTPUT

ebookmaker's People

Contributors

genericmoniker avatar hplgit avatar setanta avatar shlomif avatar

Watchers

 avatar  avatar

Forkers

rtorresca mdruger

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.