Adding pandoc template from
authorCraig Maloney <craig@decafbad.net>
Sat, 14 Apr 2018 16:00:56 +0000 (12:00 -0400)
committerCraig Maloney <craig@decafbad.net>
Sat, 14 Apr 2018 16:00:56 +0000 (12:00 -0400)
https://github.com/evangoer/pandoc-ebook-template

Makefile [new file with mode: 0644]
README.md [new file with mode: 0644]
images/cover.jpg [new file with mode: 0644]
metadata.xml [new file with mode: 0644]
title.txt [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
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 (file)
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 (file)
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 (file)
index 0000000..0efac3b
--- /dev/null
@@ -0,0 +1,2 @@
+<dc:rights>Copyright 2018, Craig Maloney and released under a CC-BY-SA International 4.0 License</dc:rights>
+<dc:language>en-US</dc:language>
diff --git a/title.txt b/title.txt
new file mode 100644 (file)
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