Sunday, November 9, 2014

How to build GitBook on Windows

If you haven't done it yet, install GitBook toolchain.

Below is a simple .CMD file to build mybook GitBook that is located in the book subdirectory. HTML version will be generated in html subdirectory, and PDF file will be generated in the same directory where .CMD file is located.

@echo off

set path=%ProgramFiles%\Calibre2;%path%

cd "%ProgramFiles%\NodeJS"

call nodevars.bat

call node %APPDATA%\npm\node_modules\gitbook\bin\gitbook.js build %~dp0\book output=%~dp0\html

call node %APPDATA%\npm\node_modules\gitbook\bin\gitbook.js pdf %~dp0\book --output=%~dp0\mybook.pdf

No comments:

Post a Comment