Skip to main content

Build leanpub books locally. Watch files and build a new pdf each time they change.

Project description

Build leanpub books locally from the command line.

Note/Disclaimer: This is not an official Leanpub product, it simply uses pandoc to build a pdf from markdown in a similar way to Leanpub. Currently the output from leanpub is different in style (and this will probably always be the case), however I find that it massively speeds up the iteration process to be able to build a pdf which looks “similar enough” to Leanpub.

This implements a simple cli for building ebooks locally. Rather than having upload your new change-set to Dropbox and then trigger leanpub build on their site - do it all locally.


To build the Book (this requires a Book.txt):

$ leanpub book

To build the Sample (this requires a Sample.txt):

$ leanpub sample

To build both:

$ leanpub all

You can also “watch” for changes in any of the markdown files you are using to build the book i.e. when a markdown file is saved:

$ leanpub watch

You can get help via the command line with:

$ leanpub --help


Install via pip:

$ pip install leanpub

Note: if you don’t have python installed I recommend `miniconda <>`__; no-admin access required.

This requires that pandoc is installed, if it’s not install it here.

Issues / troubleshooting / requests

Please post an issue on github.

Going forward

It would like to improve is have the output to better match leanpub. Any help it that direction (e.g. css, or prepending the title page) would be great!

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for leanpub, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size leanpub-0.1-py2.py3-none-any.whl (6.8 kB) File type Wheel Python version 2.7 Upload date Hashes View
Filename, size leanpub-0.1.tar.gz (5.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page