commit ae8ff708a993865d169b290263755d04b2cf08d0 Author: Daniel Herzog Date: Sun Jan 15 18:55:11 2017 +0000 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dc84959 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +build/ + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..314f830 --- /dev/null +++ b/Makefile @@ -0,0 +1,39 @@ +BUILD = build +OUTPUT_FILENAME = book +METADATA = metadata.yml +CHAPTERS = chapters/*.md +TOC = --toc --toc-depth=2 +IMAGES_FOLDER = images +COVER_IMAGE = $(COVER_IMAGE)/cover.png +LATEX_CLASS = report +MATH_FORMULAS = --webtex +CSS_FILE = style.css +CSS_ARG = --css=$(CSS_FILE) +ARGS = $(TOC) $(MATH_FORMULAS) $(CSS_ARG) + +all: book + +book: epub html pdf + +clean: + rm -r $(BUILD) + +epub: $(BUILD)/epub/$(OUTPUT_FILENAME).epub + +html: $(BUILD)/html/$(OUTPUT_FILENAME).html + +pdf: $(BUILD)/pdf/$(OUTPUT_FILENAME).pdf + +$(BUILD)/epub/$(OUTPUT_FILENAME).epub: $(METADATA) $(CHAPTERS) + mkdir -p $(BUILD)/epub + pandoc $(ARGS) -S --epub-metadata=$(METADATA) --epub-cover-image=$(COVER_IMAGE) -o $@ $^ + +$(BUILD)/html/$(OUTPUT_FILENAME).html: $(CHAPTERS) + mkdir -p $(BUILD)/html + pandoc $(ARGS) --standalone --to=html5 -o $@ $^ + cp -R $(IMAGES_FOLDER)/ $(BUILD)/html/$(IMAGES_FOLDER)/ + cp $(CSS_FILE) $(BUILD)/html/$(CSS_FILE) + +$(BUILD)/pdf/$(OUTPUT_FILENAME).pdf: $(METADATA) $(CHAPTERS) + mkdir -p $(BUILD)/pdf + pandoc $(ARGS) -V documentclass=$(LATEX_CLASS) -o $@ $^ diff --git a/README.md b/README.md new file mode 100644 index 0000000..4999f95 --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# Pandoc book template + +## Description + +This repository contains a simple template for building [Pandoc](http://pandoc.org/) documents. + +## Usage + +Please, check [this post](http://blog.danielherzog.es/2017-01-15-utils-writing-a-book-in-markdown/). + +## Contributors + +This project has been developed by: + +| Avatar | Name | Nickname | Email | +| ------ | ---- | -------- | ----- | +| ![](http://www.gravatar.com/avatar/2ae6d81e0605177ba9e17b19f54e6b6c.jpg?s=64) | Daniel Herzog | Wikiti | [info@danielherzog.es](mailto:info@danielherzog.es) diff --git a/chapters/01-introduction.md b/chapters/01-introduction.md new file mode 100644 index 0000000..798ad6c --- /dev/null +++ b/chapters/01-introduction.md @@ -0,0 +1,37 @@ +# Introduction + +This is the first paragraph of the introduction chapter. + +## First + +This is the first subsection. Please, admire the gloriousnes of Figure \ref{seagull_image}. + + +![A cool seagull.\label{seagull_image}](images/seagull.png) + +## Second + +This is the second subsection. + + +Please, check [First] subsection. + +Please, check [this](#first) subsection. + +Please, check Table \ref{example_table}. + +| Index | Name | +| ----- | ---- | +| 0 | AAA | +| 1 | BBB | +| ... | ... | + +Table: This is an example table.\label{example_table} + +## Third + +Formula example: $\mu = \sum_{i=0}^{N} \frac{x_i}{N}$ + +Now, full size: + +$$\mu = \sum_{i=0}^{N} \frac{x_i}{N}$$ diff --git a/chapters/02-installation.md b/chapters/02-installation.md new file mode 100644 index 0000000..c575165 --- /dev/null +++ b/chapters/02-installation.md @@ -0,0 +1,11 @@ +# Installation + +This is the installation chapter. + +For further information, check the [Introduction] chapter. + + +For further information, check the [this chapter](#introduction). + + +For further information, check the [this chapter's subsection](#first) section. diff --git a/chapters/03-usage.md b/chapters/03-usage.md new file mode 100644 index 0000000..ad06f02 --- /dev/null +++ b/chapters/03-usage.md @@ -0,0 +1,3 @@ +# Usage + +This is the usage chapter. diff --git a/chapters/04-references.md b/chapters/04-references.md new file mode 100644 index 0000000..b4d8446 --- /dev/null +++ b/chapters/04-references.md @@ -0,0 +1,4 @@ +# References + +- [Pandoc](http://pandoc.org/) +- [Wikipedia: Markdown](https://wikipedia.org/wiki/Markdown) diff --git a/images/cover.png b/images/cover.png new file mode 100644 index 0000000..ed3b99b Binary files /dev/null and b/images/cover.png differ diff --git a/images/seagull.png b/images/seagull.png new file mode 100644 index 0000000..e257e10 Binary files /dev/null and b/images/seagull.png differ diff --git a/metadata.yml b/metadata.yml new file mode 100644 index 0000000..ad2814f --- /dev/null +++ b/metadata.yml @@ -0,0 +1,9 @@ +--- +title: My book title +author: Daniel Herzog +rights: Creative Commons Attribution 4.0 International +language: en-US +tags: [book, my-book, etc] +abstract: | + Your summary. +--- diff --git a/style.css b/style.css new file mode 100644 index 0000000..a58cbb2 --- /dev/null +++ b/style.css @@ -0,0 +1,3 @@ +/* + * Place your css content here. + */