From 459f9a02026c2c040a82d6d6190cf0c45dc56099 Mon Sep 17 00:00:00 2001 From: Pengfei Ni Date: Mon, 15 May 2017 09:07:11 +0800 Subject: [PATCH] Add a makefile --- Makefile | 42 ++++++++++++++++++++++++++++++++++++++++++ book.json | 2 +- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..4fc4c8b76 --- /dev/null +++ b/Makefile @@ -0,0 +1,42 @@ +BOOK_NAME := kubernetes-handbook +BOOK_OUTPUT := _book + +.PHONY: build +build: + gitbook build . $(BOOK_OUTPUT) + +.PHONY: serve +serve: + gitbook serve . $(BOOK_OUTPUT) + +.PHONY: epub +epub: + gitbook epub . $(BOOK_NAME).epub + +.PHONY: pdf +pdf: + gitbook pdf . $(BOOK_NAME).pdf + +.PHONY: mobi +mobi: + gitbook mobi . $(BOOK_NAME).pdf + +.PHONY: install +install: + npm install gitbook-cli -g + gitbook install + +.PHONY: clean +clean: + rm -rf $(BOOK_OUTPUT) + +.PHONY: help +help: + @echo "Help for make" + @echo "make - Build the book" + @echo "make build - Build the book" + @echo "make serve - Serving the book on localhost:4000" + @echo "make install - Install gitbook and plugins" + @echo "make epub - Build epub book" + @echo "make pdf - Build pdf book" + @echo "make clean - Remove generated files" diff --git a/book.json b/book.json index 73ab3f81d..e4738d340 100644 --- a/book.json +++ b/book.json @@ -1,5 +1,5 @@ { - "gitbook": "3.2.0", + "gitbook": ">= 3.2.2", "plugins": ["mermaid", "katex"], "pluginsConfig": { "mathjax":{