GithubHelp home page GithubHelp logo

roboe / epubmake Goto Github PK

View Code? Open in Web Editor NEW

This project forked from daniel-j/epubmake

0.0 2.0 0.0 16 KB

Makefile for EPUB ebook development

Home Page: https://github.com/daniel-j/epubmake/pull/3

Makefile 31.60% Python 65.28% Shell 3.13%

epubmake's Introduction

EPUB Makefile helper

I (djazz) created this tool as a companion to when I edit the epub in Sigil, but you can use any editor/toolchain. You can use this Makefile and create a local git repo and keep your ebook in version control.

How to use

Make sure you have the make command and python3 with lxml installed available. You also need java to be able to validate the ebook with EpubCheck, inotifywait from inotify-tools and Calibre for the tools ebook-polish and ebook-view. Kindle export requires ImageMagick.

  • Copy your epub ebook and put it next to the Makefile and rename it to current.epub. This is a hardcoded name that the tool uses to read the book from.
  • Open a terminal and run make extractcurrent. This will populate src/ with the contents of the ebook using unzip. Alternatively, you can run make init if you're making an ebook from scratch. It does not generate a valid ebook, just the basic files and folder structure.
  • You can now validate the ebook. Run make validate. It first builds the epub into build/ based on the contents of src/ (make build). Then it downloads EpubCheck (only first time) and runs it on the ebook.
  • You can open the built ebook in Calibre's viewer with make view.
  • You can export a Kindle ebook by running make buildkindle. This will on first run download KindleGen (Linux version only). KindleGen might output some helpful warnings on how you can improve the epub file. By default the Makefile uses KindleGen's -c1 compression, but you can change that if you want. If you prefer Calibre's ebook-convert, run make buildazw3.
  • Open up current.epub in your epub editor. Run make watchcurrent. The tool will now wait until you save the file. When you do it will run the validator on it. It's quite useful to spot errors or warnings as you edit the epub. When you're done, run make extractcurrent and the src/ directory is updated. This will overwrite everything in src/.
  • You can run make release to validate, build for kobo/kindle and copy them to release/ with the current date in filename.

You're welcome to look at the Makefile to understand what it does and how it works.

Version control

You can fork and/or clone this repository and add your own ebook as current.epub. Then run make extractcurrent and make build. Make it a habit to run make validate before you publish or share the built ebook.

Create a new git repository (or fork this) and commit your book. With every new release of the book you can also tag it with either version numbers or current date. This is so you later can go back and look at the difference between revisions. The power of version control!

License

This is free and unencumbered software released into the public domain.

epubmake's People

Contributors

daniel-j avatar roboe avatar

Watchers

 avatar  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.