From: Craig Maloney Date: Sat, 14 Apr 2018 16:00:56 +0000 (-0400) Subject: Adding pandoc template from X-Git-Tag: 0.2.0^2~14 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=4cccb5c75f88dd3f4d671f455fca5c034917eaba;p=themediocreprogrammer.git Adding pandoc template from https://github.com/evangoer/pandoc-ebook-template --- diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7fca8a3 --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +BUILD = build +BOOKNAME = the_mediocre_programmer +TITLE = title.txt +METADATA = metadata.xml +CHAPTERS = intro.md chapter01.md +TOC = --toc --toc-depth=2 +COVER_IMAGE = images/cover.jpg +LATEX_CLASS = report + +all: book + +book: epub html pdf + +clean: + rm -r $(BUILD) + +epub: $(BUILD)/epub/$(BOOKNAME).epub + +html: $(BUILD)/html/$(BOOKNAME).html + +pdf: $(BUILD)/pdf/$(BOOKNAME).pdf + +$(BUILD)/epub/$(BOOKNAME).epub: $(TITLE) $(CHAPTERS) + mkdir -p $(BUILD)/epub + pandoc $(TOC) -S --epub-metadata=$(METADATA) --epub-cover-image=$(COVER_IMAGE) -o $@ $^ + +$(BUILD)/html/$(BOOKNAME).html: $(CHAPTERS) + mkdir -p $(BUILD)/html + pandoc $(TOC) --standalone --to=html5 -o $@ $^ + +$(BUILD)/pdf/$(BOOKNAME).pdf: $(TITLE) $(CHAPTERS) + mkdir -p $(BUILD)/pdf + pandoc $(TOC) --latex-engine=xelatex -V documentclass=$(LATEX_CLASS) -o $@ $^ + +.PHONY: all book clean epub html pdf diff --git a/README.md b/README.md new file mode 100644 index 0000000..3f139f4 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +This is the (work-in-progress) text for the upcoming book "The Mediocre Programmer". + +Released under a CC-BY-SA 4.0 International license. + +(Uses Pandoc Markdown Template / Makefile from https://github.com/evangoer/pandoc-ebook-template) diff --git a/images/cover.jpg b/images/cover.jpg new file mode 100644 index 0000000..d92d4b8 Binary files /dev/null and b/images/cover.jpg differ diff --git a/metadata.xml b/metadata.xml new file mode 100644 index 0000000..0efac3b --- /dev/null +++ b/metadata.xml @@ -0,0 +1,2 @@ +Copyright 2018, Craig Maloney and released under a CC-BY-SA International 4.0 License +en-US diff --git a/title.txt b/title.txt new file mode 100644 index 0000000..7100693 --- /dev/null +++ b/title.txt @@ -0,0 +1,3 @@ +% The Mediocre Programmer +% Craig Maloney +% Released under the CC-BY-SA International 4.0 license