Skip to content

Commit 8d4cfa2

Browse files
authored
Merge pull request #1 from addyosmani/gh-pages
merge upstream
2 parents 0ee70cb + 0f96763 commit 8d4cfa2

File tree

209 files changed

+116623
-41085
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+116623
-41085
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.DS_Store
2+
*.log

Makefile

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
include_dir=build
2-
source=index.md
2+
source=chapters/*.md
33
title='Developing Backbone.js Applications'
44
filename='backbone-fundamentals'
55

66

77
all: html epub rtf pdf mobi
88

9-
html:
10-
pandoc -s $(source) -t html5 -o index.html -c style.css \
9+
markdown:
10+
awk 'FNR==1{print ""}{print}' $(source) > $(filename).md
11+
12+
html: markdown
13+
pandoc -s $(filename).md -t html5 -o index.html -c style.css \
1114
--include-in-header $(include_dir)/head.html \
1215
--include-before-body $(include_dir)/author.html \
1316
--include-before-body $(include_dir)/share.html \
@@ -17,8 +20,8 @@ html:
1720
--smart \
1821
--toc
1922

20-
epub:
21-
pandoc -s $(source) --normalize --smart -t epub -o $(filename).epub \
23+
epub: markdown
24+
pandoc -s $(filename).md --normalize --smart -t epub -o $(filename).epub \
2225
--epub-metadata $(include_dir)/metadata.xml \
2326
--epub-stylesheet epub.css \
2427
--epub-cover-image img/cover.jpg \
@@ -27,22 +30,23 @@ epub:
2730
--smart \
2831
--toc
2932

30-
rtf:
31-
pandoc -s $(source) -o $(filename).rtf \
33+
rtf: markdown
34+
pandoc -s $(filename).md -o $(filename).rtf \
3235
--title-prefix $(title) \
3336
--normalize \
3437
--smart
3538

36-
pdf:
39+
pdf: markdown
3740
# You need `pdflatex`
3841
# OS X: http://www.tug.org/mactex/
3942
# Then find its path: find /usr/ -name "pdflatex"
4043
# Then symlink it: ln -s /path/to/pdflatex /usr/local/bin
41-
pandoc -s $(source) -o $(filename).pdf \
44+
pandoc -s $(filename).md -o $(filename).pdf \
4245
--title-prefix $(title) \
4346
--normalize \
4447
--smart \
45-
--toc
48+
--toc \
49+
--latex-engine=`which xelatex`
4650

4751
mobi: epub
4852
# Download: http://www.amazon.com/gp/feature.html?ie=UTF8&docId=1000765211

README.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,36 @@
22

33
## About
44

5-
This is the home of [Developing Backbone.js Applications](http://shop.oreilly.com/product/0636920025344.do), an (in-progress) book about the
6-
Backbone.js library for structuring JavaScript applications. It is released under a
7-
Creative Commons Attribution-Noncommercial- No Derivative Works 3.0 United States License and is currently available for early purchase via O'Reilly if you would like to support the project.
5+
This is the home of [Developing Backbone.js Applications](http://shop.oreilly.com/product/0636920025344.do), an open-source book about the Backbone.js library for structuring JavaScript applications. It is released under a
6+
Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License and is currently available for early purchase via O'Reilly if you would like to support the project.
87

9-
We appreciate any and all efforts to help improve the book. If you would like to submit pull requests, please feel free to apply them against `index.md`. These can be previewed by running the build script via `make`, which will also generate updated versions of the other formats we support.
8+
## Contributing
9+
10+
We appreciate any and all efforts to help improve the book. Please note that the repository is structured as follows:
11+
12+
* chapters - contains the source Markdown for each chapter. This is compiled into the HTML, ePub, Mobi and other formats found in the root of the project.
13+
* build - contains templates and metadata for compiling the book
14+
* img - contains image assets for the project
15+
* practicals - contains the source code for practicals
16+
17+
If you would like to submit pull requests, please feel free to apply them against the relevant markdown file in `chapter`. These can be previewed by running the build script via `make`, which will also generate updated versions of the other formats we support. Please ensure that you are only submitting the modified chapter file for your changes and not the compiled HTML/other format binaries.
1018

1119
## Reviews
1220

13-
If you are interested in leaving a review to let others know what you thoughts of the book this can be done through [O'Reilly](http://shop.oreilly.com/product/0636920025344/ReviewSubmit.do?sortby=publicationDate?pageId=0636920025344.IP).
21+
If you are interested in leaving a review to share your opinion on the book with others (it's always appreciated!), you can do so through [O'Reilly](http://shop.oreilly.com/product/0636920025344/ReviewSubmit.do?sortby=publicationDate?pageId=0636920025344.IP).
1422

1523
## Building
1624

17-
You can build the book using `make` or `make -f Makefile`. This will output the HTML, ePub, PDF and RTF versions of the book.
25+
You can build the book using `make` or `make -f Makefile`. This will output the HTML, ePub, Mobi, PDF and RTF versions of the book.
26+
27+
Note: At this time, generating all of the above formats should be straight-forward with the exception of the PDF. We have an open [pull-request](https://github.com/addyosmani/backbone-fundamentals/pull/369) for `xelatex` which is being considered and better guides for working around cross-platform PDF issues will be supplied as time allows.
28+
29+
### Dependencies
30+
31+
* Make
32+
* [Pandoc](https://github.com/jgm/pandoc)
33+
* pdflatex (and recommended latex fonts)
34+
35+
#### Linux Debian based distros:
36+
37+
<code>apt-get install pandoc texlive-latex-base texlive-fonts-recommended cm-super etoolbox</code>

backbone-fundamentals.epub

3.63 MB
Binary file not shown.

0 commit comments

Comments
 (0)