LeanPub is an awesome publishing platform, but often we need to communicate with other team members involved in the book production, e.g., content and copy editors. In such times, I’ve learned that Guy Kawasaki was right — when we suggested in his book APE: Author, Publisher, Entrepreneur — that author must use MS Word!
The problem is that LeanPub uses multi-file book format and a special markdown markup (that confuses Marked app). I was wrapping up a new revision of the Rapid Prototyping with JS book and previous experience of handing a txt file to an editor was poor. Luckily, Node.js came to help! Through some trail and error attempts, I found this workflow to be the best for converting LeanPub manuscript to a one MS Word file (for editing and other needs):
- Run leanpub-tool.js with Node.js (node leanpub-tool.js)
- Open file in Marked app and convert to HTML
- Open HTML in MS Word and enjoy.
The full code of leanpub-tool.js which is also available at https://gist.github.com/azat-co/5674684: