Skip to content

Commit

Permalink
Convert to markdown, upgrade to responsive layout and markdown-styles
Browse files Browse the repository at this point in the history
  • Loading branch information
mixu committed Sep 25, 2015
1 parent 4fa4a82 commit b8c0a31
Show file tree
Hide file tree
Showing 126 changed files with 20,204 additions and 5,530 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -1 +1,3 @@
node_modules/ node_modules/
tmp/
.DS_Store
47 changes: 47 additions & 0 deletions Makefile
@@ -1,3 +1,37 @@
book: concat
generate-md \
--layout ./layout \
--input ./input \
--output ./output

.PHONY: book

concat:
rm -rf ./tmp || true
mkdir ./tmp
cat input/index.md > ./tmp/single.md
cat input/goal.md | bin/remove-meta.js >> ./tmp/single.md
cat input/maintainability1.md | bin/remove-meta.js>> ./tmp/single.md
cat input/maintainability2.md | bin/remove-meta.js >> ./tmp/single.md
cat input/maintainability3.md | bin/remove-meta.js >> ./tmp/single.md
cat input/detail1.md | bin/remove-meta.js >> ./tmp/single.md
cat input/detail2.md | bin/remove-meta.js >> ./tmp/single.md
cat input/collections1.md | bin/remove-meta.js >> ./tmp/single.md
cat input/collections2.md | bin/remove-meta.js >> ./tmp/single.md
cat input/collections3.md | bin/remove-meta.js >> ./tmp/single.md
cat input/collections4.md | bin/remove-meta.js >> ./tmp/single.md
cat input/collections5.md | bin/remove-meta.js >> ./tmp/single.md
cat input/views1.md | bin/remove-meta.js >> ./tmp/single.md
cat input/views2.md | bin/remove-meta.js >> ./tmp/single.md
cat input/views3.md | bin/remove-meta.js >> ./tmp/single.md
generate-md \
--input ./tmp/single.md \
--layout ./layout \
--output ./output
cp ./output/single.html ./output/single-page.html

.PHONY: concat

book.mobi: book.mobi:
@echo "\n... generating $@" @echo "\n... generating $@"
ebook-convert output/single-page.html output/mixu-single-page-apps.mobi \ ebook-convert output/single-page.html output/mixu-single-page-apps.mobi \
Expand All @@ -9,6 +43,8 @@ book.mobi:
--language en \ --language en \
--output-profile kindle --output-profile kindle


.PHONY: book.mobi

book.epub: book.epub:
@echo "\n... generating $@" @echo "\n... generating $@"
ebook-convert output/single-page.html output/mixu-single-page-apps.epub \ ebook-convert output/single-page.html output/mixu-single-page-apps.epub \
Expand All @@ -19,3 +55,14 @@ book.epub:
--authors "Mikito Takada" \ --authors "Mikito Takada" \
--no-default-epub-cover \ --no-default-epub-cover \
--language en --language en

.PHONY: book.epub

upload:
aws s3 sync ./output/ s3://singlepageappbook.com/ \
--region us-west-1 \
--delete \
--exclude "node_modules/*" \
--exclude ".git"

.PHONY: upload
15 changes: 15 additions & 0 deletions bin/remove-meta.js
@@ -0,0 +1,15 @@
#!/usr/bin/env node
var md = require('markdown-stream-utils'),
pi = require('pipe-iterators');

process.stdin.setEncoding('utf8');

process.stdin
.pipe(pi.reduce(function(obj, current) {
obj.contents += current;
return obj;
}, { content: '' }))
.pipe(md.parseHeader())
.pipe(pi.map(function(obj) { return obj.contents; }))
.pipe(process.stdout);

35 changes: 0 additions & 35 deletions bookgen/extras.html

This file was deleted.

108 changes: 0 additions & 108 deletions bookgen/generate.js

This file was deleted.

55 changes: 0 additions & 55 deletions generate.js

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added input/assets/image.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
52 changes: 52 additions & 0 deletions input/assets/prettify.css
@@ -0,0 +1,52 @@
/* Pretty printing styles. Used with prettify.js. */

/* SPAN elements with the classes below are added by prettyprint. */
.pln { color: #000 } /* plain text */

@media screen {
.str { color: #080 } /* string content */
.kwd { color: #008 } /* a keyword */
.com { color: #800 } /* a comment */
.typ { color: #606 } /* a type name */
.lit { color: #066 } /* a literal value */
/* punctuation, lisp open bracket, lisp close bracket */
.pun, .opn, .clo { color: #660 }
.tag { color: #008 } /* a markup tag name */
.atn { color: #606 } /* a markup attribute name */
.atv { color: #080 } /* a markup attribute value */
.dec, .var { color: #606 } /* a declaration; a variable name */
.fun { color: red } /* a function name */
}

/* Use higher contrast and text-weight for printable form. */
@media print, projection {
.str { color: #060 }
.kwd { color: #006; font-weight: bold }
.com { color: #600; font-style: italic }
.typ { color: #404; font-weight: bold }
.lit { color: #044 }
.pun, .opn, .clo { color: #440 }
.tag { color: #006; font-weight: bold }
.atn { color: #404 }
.atv { color: #060 }
}

/* Put a border around prettyprinted code snippets. */
pre.prettyprint { background: none; font-size: 14px;}

/* Specify class=linenums on a pre to get line numbering */
ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */
li.L0,
li.L1,
li.L2,
li.L3,
li.L5,
li.L6,
li.L7,
li.L8 { list-style-type: none }
/* Alternate shading for lines */
li.L1,
li.L3,
li.L5,
li.L7,
li.L9 { background: #eee }

0 comments on commit b8c0a31

Please sign in to comment.