Twitter LinkedIn Github

JetBrains

I’m a really big fan of Leanpub, a self-pubishing site that not only gives authors a really sweet deal but also provides an amazing experience when working with it.


Simply put, you sign up and link your Dropbox account. It creates a folder strucutre for you with a manuscript subfolder where you write your chapters using Markdown. Once you’re done you publish your book and put it up for sale!


Leanpub Folder

Of course, Dropbox is just one of the multiple options. You can also use Git/GitHub amongst other alternatives.


Leanpub handle everything for you in terms of transactions. You can even push your books to Amazon, albeit Amazon take a much larger cut than Leanpub (which is approximately 10%).

Previews and Publishing

I use WebStorm for writing Markdown, which by the way, now comes with a really sweet Preview window using JavaFX


Leanpub Preview

I’ve already written about some tips and tricks for working with Markdown and WebStorm so won’t rehash them here.


While the experience is great I found there was a missing part. Leanpub allows you to generate previews to see progress of your book. In order to do this, you need to go to the website and do it via your author dashboard. It’s not a big deal but it does prove somewhat cumbersome, especially if you want to generate these frequently.

And that’s where my plugin comes in. Given I’ve been working extensively with Leanpub recently (soon to be revealed, and no it’s not what you think), I wrote a simple plugin that uses Leanpub’s API to generate previews (as well as publish) directly from WebStorm*

To use it, install the plugin and configure the API and slug, which can be obtained from your Leanpub author dashboard.


Leanpub Config

Once configured, you can simply use the menu entries to generate previews and/or publish your book. Leanpub then generates these in multiple formats and places them in the preview and published folder respectively in your Dropbox.


Leanpub Tool menu

Currently it does not support partial preview generations, but I’ll get round to it. And given it’s OSS, please feel free to fork and contribute!

*It actually works on IntelliJ IDEA, WebStorm or any of our other IDE’s.