diff --git a/.circleci/config.yml b/.circleci/config.yml index 85d6702..da1fa07 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,3 +34,8 @@ jobs: name: Check if pdf exists command: test -s build/pdf/book.pdf + + - run: + name: Check if docx exists + command: + test -s build/docx/book.docx diff --git a/Makefile b/Makefile index 8857f31..49f72b0 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,7 @@ PANDOC_COMMAND = pandoc EPUB_ARGS = --epub-cover-image=$(COVER_IMAGE) HTML_ARGS = --standalone --to=html5 PDF_ARGS = -V geometry:margin=1in -V documentclass=report --pdf-engine=xelatex +DOCX_ARGS = #################################################################################################### # Basic actions @@ -44,7 +45,7 @@ PDF_ARGS = -V geometry:margin=1in -V documentclass=report --pdf-engine=xelatex all: book -book: epub html pdf +book: epub html pdf docx clean: rm -r $(BUILD) @@ -59,6 +60,8 @@ html: $(BUILD)/html/$(OUTPUT_FILENAME).html pdf: $(BUILD)/pdf/$(OUTPUT_FILENAME).pdf +docx: $(BUILD)/docx/$(OUTPUT_FILENAME).docx + $(BUILD)/epub/$(OUTPUT_FILENAME).epub: $(MAKEFILE) $(METADATA) $(CHAPTERS) $(CSS_FILE) $(IMAGES) \ $(COVER_IMAGE) mkdir -p $(BUILD)/epub @@ -76,3 +79,8 @@ $(BUILD)/pdf/$(OUTPUT_FILENAME).pdf: $(MAKEFILE) $(METADATA) $(CHAPTERS) $(CSS_F mkdir -p $(BUILD)/pdf $(PANDOC_COMMAND) $(ARGS) $(PDF_ARGS) -o $@ $(CHAPTERS) @echo "$@ was built" + +$(BUILD)/docx/$(OUTPUT_FILENAME).docx: $(MAKEFILE) $(METADATA) $(CHAPTERS) $(CSS_FILE) $(IMAGES) + mkdir -p $(BUILD)/docx + $(PANDOC_COMMAND) $(ARGS) $(DOCX_ARGS) -o $@ $(CHAPTERS) + @echo "$@ was built" diff --git a/README.md b/README.md index b99a157..ed2e4a1 100644 --- a/README.md +++ b/README.md @@ -278,7 +278,13 @@ util*, we're going to use some *make* commands. #### Export to PDF -Use this command: +Please note that PDF file generation requires some extra dependencies (~ 800 MB): + +```sh +sudo apt-get install texlive-xetex ttf-dejavu +``` + +After installing the dependencies, use this command: ```sh make pdf @@ -286,12 +292,6 @@ make pdf The generated file will be placed in *build/pdf*. -Please, note that PDF file generation requires some extra dependencies (~ 800 MB): - -```sh -sudo apt-get install texlive-xetex ttf-dejavu -``` - #### Export to EPUB Use this command: @@ -312,6 +312,16 @@ make html The generated file(s) will be placed in *build/html*. +#### Export to DOCX + +Use this command: + +```sh +make docx +``` + +The generated file(s) will be placed in *build/docx*. + #### Extra configuration If you want to configure the output, you'll probably have to look the