Skip to content

Commit 1346d1c

Browse files
emilbryggaremarijnh
authored andcommitted
Add book.mobi target
1 parent fd4da04 commit 1346d1c

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@
2626
/epub/img/*
2727
/epub/content.opf
2828
/book.epub
29+
/book.mobi

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,6 @@ epub/hints.xhtml: $(foreach CHAP,$(CHAPTERS),$(CHAP).txt) bin/extract_hints.js
118118

119119
epubcheck: book.epub
120120
epubcheck book.epub 2>&1 | grep -v 'img/.*\.svg'
121+
122+
book.mobi: book.epub img/cover.png
123+
ebook-convert book.epub book.mobi --output-profile=kindle --cover=img/cover.png --remove-first-image

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Feedback welcome, in the form of issues and pull requests.
88
## Building
99

1010
npm install --production
11-
apt-get install asciidoc inkscape
11+
apt-get install asciidoc inkscape calibre
1212
make html
1313

1414
For OSX, you can use port or brew to install the asciidoc package.
@@ -21,3 +21,7 @@ To build the PDF file:
2121
To build the ePub book:
2222

2323
make book.epub
24+
25+
To build a mobi book from the epub book:
26+
27+
make book.mobi

html/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ <h2>Other pages</h2>
9898
<li><a href="errata.html">Errata for the paper book</a></li>
9999
<li><a href="http://eloquentjavascript.net/Eloquent_JavaScript.pdf">This book as a single PDF file</a> (&amp; <a href="http://eloquentjavascript.net/Eloquent_JavaScript_small.pdf">small version for mobile</a>)</li>
100100
<li><a href="http://eloquentjavascript.net/Eloquent_JavaScript.epub">This book as an EPUB file</a></li>
101+
<li><a href="http://eloquentjavascript.net/Eloquent_JavaScript.mobi">This book as an MOBI (Kindle) file</a></li>
101102
<li><a href="http://eloquentjavascript.net/1st_edition">The first edition of the book</a></li>
102103
</ul>
103104

0 commit comments

Comments
 (0)