Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
davorg committed Jan 2, 2016
0 parents commit 3bd404d
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@
*.epub
*.mobi
*.pdf
23 changes: 23 additions & 0 deletions Makefile
@@ -0,0 +1,23 @@
book = yourbookname
chapters = $(shell cat chapters.txt)

epub: book

book: $(book).epub

mobi: $(book).mobi

pdf: $(book).pdf

$(book).mobi: $(book).epub
kindlegen -verbose $(book).epub

$(book).epub: $(chapters) epub.css
pandoc -o $(book).epub title.txt $(chapters) --epub-metadata=metadata.xml --toc --toc-depth=2 --epub-stylesheet=epub.css

$(book).pdf: $(book).epub
ebook-convert $(book).epub $(book).pdf

clean:
rm -f $(book).{pdf,epub,mobi}

Empty file added chapters.txt
Empty file.
17 changes: 17 additions & 0 deletions epub.css
@@ -0,0 +1,17 @@
/* This defines styles and classes used in the book */
h1, h2, h3, h4, h5, h6, body {
font-family: arail, helvetica, sans-serif;
}
body { margin: 5%; text-align: justify; font-size: medium; }
code { font-family: monospace; }
h1 { text-align: left; }
h2 { text-align: left; }
h3 { text-align: left; }
h4 { text-align: left; }
h5 { text-align: left; }
h6 { text-align: left; }
h1.title { }
h2.author { }
h3.date { }
ol.toc { padding: 0; margin-left: 1em; }
ol.toc li { list-style-type: none; margin: 0; padding: 0; }
9 changes: 9 additions & 0 deletions metadata.xml
@@ -0,0 +1,9 @@
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:title id="main">YOUR TITLE HERE</dc:title>
<meta refines="#main" property="title-type">main</meta>
<dc:language>en-GB</dc:language>
<dc:creator opf:file-as="SURNAME, FORENAME" opf:role="aut">FORENAME SURNAME</dc:creator>
<dc:publisher>YOUR PUBLISHER HERE</dc:publisher>
<dc:date opf:event="publication">YYYY-MM-DD</dc:date>
<dc:rights>Copyright ©2014 by FORENAME SURNAME</dc:rights>
</metadata>
2 changes: 2 additions & 0 deletions title.txt
@@ -0,0 +1,2 @@
% YOUR TITLE HERE
% AUTHOR NAME HERE

0 comments on commit 3bd404d

Please sign in to comment.