add boilerplate

This commit is contained in:
Fengda HUANG 2015-03-08 22:40:01 +08:00
commit 77e9b17a36
16 changed files with 261 additions and 0 deletions

53
Makefile Normal file
View file

@ -0,0 +1,53 @@
include_dir=build
source=chapters/*.md
title='Github 漫游指南'
filename='github-roam'
all: html epub rtf pdf mobi
markdown:
awk 'FNR==1{print ""}{print}' $(source) > $(filename).md
html: markdown
pandoc -s $(filename).md -t html5 -o index.html -c style.css \
--include-in-header $(include_dir)/head.html \
--include-before-body $(include_dir)/author.html \
--include-before-body $(include_dir)/share.html \
--include-after-body $(include_dir)/stats.html \
--title-prefix $(title) \
--normalize \
--smart \
--toc
epub: markdown
pandoc -s $(filename).md --normalize --smart -t epub -o $(filename).epub \
--epub-metadata $(include_dir)/metadata.xml \
--epub-stylesheet epub.css \
--epub-cover-image img/cover.jpg \
--title-prefix $(title) \
--normalize \
--smart \
--toc
rtf: markdown
pandoc -s $(filename).md -o $(filename).rtf \
--title-prefix $(title) \
--normalize \
--smart
pdf: markdown
# You need `pdflatex`
# OS X: http://www.tug.org/mactex/
# Then find its path: find /usr/ -name "pdflatex"
# Then symlink it: ln -s /path/to/pdflatex /usr/local/bin
pandoc -s $(filename).md -o $(filename).pdf \
--title-prefix $(title) \
--normalize \
--smart \
--toc \
--latex-engine=`which xelatex`
# mobi: epub
# Symlink bin: ln -s /path/to/kindlegen /usr/local/bin
# kindlegen $(filename).epub

5
build/author.html Normal file
View file

@ -0,0 +1,5 @@
<p>
<h1>Github Roam</h1>
<h3>By Phodal Huang(<a href="http://www.phodal.com">Geek's Life</a>)</h3>
</p>

1
build/head.html Normal file
View file

@ -0,0 +1 @@
<meta name="viewport" content="width=device-width">

4
build/metadata.xml Normal file
View file

@ -0,0 +1,4 @@
<dc:title>Github 漫游指南</dc:title>
<dc:creator>Phodal</dc:creator>
<dc:rights>Creative Commons Attribution Non-Commercial Share Alike 3.0</dc:rights>
<dc:language>zh-CN</dc:language>

5
build/share.html Normal file
View file

@ -0,0 +1,5 @@
<div style="width:500px">
<iframe src="http://ghbtns.com/github-btn.html?user=phodal&repo=github-roam&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110px" height="20px"></iframe>
<div>

0
build/stats.html Normal file
View file

2
build/title.txt Normal file
View file

@ -0,0 +1,2 @@
% Github 漫游指南
% Phodal Huang

0
chapters/00-prelude.md Normal file
View file

View file

157
epub.css Normal file
View file

@ -0,0 +1,157 @@
html, body, div, span,
h1, h2, h3, h4, h5, h6,
p, a, em, strong, b, u, i, pre, code, del, strike,
abbr, acronym, address, q, cite, blockquote,
big, small, sub, sup, tt, var, center,
img, dfn, ins, kbd, s, samp,
dl, dt, dd, ol, ul, li,
fieldset, legend, label,
table, caption, tbody, tfoot, thead, tr, th, td
{
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
}
@page {
margin: 5px;
}
p {
margin-bottom: 9px;
line-height: 1.4;
}
a {
color: #0069d6;
}
a:hover {
color: #0050a3;
text-decoration: none;
}
a img {
border: none;
}
h1,
h2,
h3,
h4,
h5,
h6 {
color: #404040;
line-height: 1.5;
margin: 1em 0 0.5em;
-webkit-hyphens: none;
hyphens: none;
adobe-hyphenate: none;
}
h1 {
font-size: 220%;
margin-bottom: 1.5em;
}
h2 {
font-size: 190%;
}
h3 {
font-size: 160%;
}
h4 {
font-size: 140%;
}
h5 {
font-size: 130%;
}
h6 {
font-size: 120%;
}
hr {
margin: 0 0 19px;
border: 0;
border-bottom: 1px solid #ccc;
}
blockquote {
padding: 13px 13px 21px 15px;
margin-bottom: 18px;
font-family:georgia,serif;
font-style: italic;
}
blockquote:before {
content: "\201C";
font-size: 300%;
margin-left: -10px;
font-family: serif;
color: #eee;
}
blockquote p {
font-size: 120%;
margin-bottom: 0;
font-style: italic;
}
code, pre {
font-family: monospace;
}
code {
background-color: #fee9cc;
color: rgba(0, 0, 0, 0.75);
padding: 1px 3px;
-webkit-border-radius: 5px;
border-radius: 5px;
font-size: 85%;
}
pre {
display: block;
padding: 14px;
margin: 0 0 18px;
font-size: 85%;
line-height: 1.3;
border: 1px solid #d9d9d9;
white-space: pre-wrap;
word-wrap: break-word;
-webkit-hyphens: none;
hyphens: none;
adobe-hyphenate: none;
}
pre code {
background-color: #fff;
color: #737373;
padding: 0;
}
code.sourceCode span.kw { color: #007020; font-weight: bold; }
code.sourceCode span.dt { color: #902000; }
code.sourceCode span.dv { color: #40a070; }
code.sourceCode span.bn { color: #40a070; }
code.sourceCode span.fl { color: #40a070; }
code.sourceCode span.ch { color: #4070a0; }
code.sourceCode span.st { color: #4070a0; }
code.sourceCode span.co { color: #60a0b0; font-style: italic; }
code.sourceCode span.ot { color: #007020; }
code.sourceCode span.al { color: red; font-weight: bold; }
code.sourceCode span.fu { color: #06287e; }
code.sourceCode span.re { }
code.sourceCode span.er { color: red; font-weight: bold; }
body {
font-family: serif;
}

BIN
github-roam.epub Normal file

Binary file not shown.

0
github-roam.md Normal file
View file

BIN
github-roam.pdf Normal file

Binary file not shown.

6
github-roam.rtf Normal file
View file

@ -0,0 +1,6 @@
{\rtf1\ansi\deff0{\fonttbl{\f0 \fswiss Helvetica;}{\f1 Courier;}}
{\colortbl;\red255\green0\blue0;\red0\green0\blue255;}
\widowctrl\hyphauto
}

BIN
img/cover.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

28
index.html Normal file
View file

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="generator" content="pandoc">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>Github 漫游指南 - </title>
<style type="text/css">code{white-space: pre;}</style>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="style.css">
<meta name="viewport" content="width=device-width">
</head>
<body>
<p>
<h1>Github Roam</h1>
<h3>By Phodal Huang(<a href="http://www.phodal.com">Geek's Life</a>)</h3>
</p>
<div style="width:500px">
<iframe src="http://ghbtns.com/github-btn.html?user=phodal&repo=github-roam&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110px" height="20px"></iframe>
<div>
</body>
</html>