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

call nodevars.bat

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

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

No comments:

Post a Comment