Giter Club home page Giter Club logo

leanpub's Introduction

leanpub cli

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.

Usage

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

Installation

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

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

leanpub's People

Contributors

hayd avatar mte90 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

leanpub's Issues

Allow override for --top-level-division option

First of all, thanks for the library, it's really handy!

I noticed that it currently defaults to --top-level-division=chapter and I could not find a way to override this value to part, using the leanpub command, so I hacked the library locally to change the hardcoded value.

If you could provide an option for that (or in general to pass through parameters to the pandoc command), it would be really helpful.

No windoze support

On windoze it just echoes this:

E:\leanbook\manuscript>python -m leanpub book
"Starting build of Book.pdf";pandoc 01intro 02terminology 03site-packages 04installing-manually 05source-package.md package automating.txt chapter3.txt  --smart --table-of-contents -
-chapters -o Book.pdf;echo "  Book.pdf created."

I guess that's because there echo command there doesn't care about quotes or that special ; sign.

Missing link

I was looking to see also what happen with links in markdown files but the pdf versions doesn't include them so fro me is not enough this pdf preview.

pandoc parameters not working

I encountered some parameter changes using pandoc. The following changes had to be applied in the watcher.py file:

--smart -> -f markdown-smart
--chapters -> top-level-division=chapter

Error

$ leanpub book

pandoc: {frontmatter}: openBinaryFile: does not exist (No such file or directory)

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.