Initial commit

This commit is contained in:
Daniel Herzog 2017-01-15 18:55:11 +00:00
commit ae8ff708a9
11 changed files with 125 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
build/

39
Makefile Normal file
View File

@ -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 $@ $^

17
README.md Normal file
View File

@ -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)

View File

@ -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}$$

View File

@ -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.

3
chapters/03-usage.md Normal file
View File

@ -0,0 +1,3 @@
# Usage
This is the usage chapter.

View File

@ -0,0 +1,4 @@
# References
- [Pandoc](http://pandoc.org/)
- [Wikipedia: Markdown](https://wikipedia.org/wiki/Markdown)

BIN
images/cover.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
images/seagull.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

9
metadata.yml Normal file
View File

@ -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.
---

3
style.css Normal file
View File

@ -0,0 +1,3 @@
/*
* Place your css content here.
*/