Bläddra i källkod

Add boilerplate

Fengda HUANG 9 år sedan
förälder
incheckning
443ac6c54d
16 ändrade filer med 261 tillägg och 0 borttagningar
  1. 53 0
      Makefile
  2. 5 0
      build/author.html
  3. 1 0
      build/head.html
  4. 4 0
      build/metadata.xml
  5. 5 0
      build/share.html
  6. 0 0
      build/stats.html
  7. 2 0
      build/title.txt
  8. 0 0
      chapters/00-prelude.md
  9. 0 0
      chapters/01-introduction.md
  10. 157 0
      epub.css
  11. BIN
      img/cover.jpg
  12. 28 0
      index.html
  13. BIN
      repractise.epub
  14. 0 0
      repractise.md
  15. BIN
      repractise.pdf
  16. 6 0
      repractise.rtf

+ 53 - 0
Makefile

@@ -0,0 +1,53 @@
+include_dir=build
+source=chapters/*.md
+title='RePractise'
+filename='repractise'
+
+
+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 - 0
build/author.html

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

+ 1 - 0
build/head.html

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

+ 4 - 0
build/metadata.xml

@@ -0,0 +1,4 @@
+<dc:title>RePractise</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 - 0
build/share.html

@@ -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 - 0
build/stats.html


+ 2 - 0
build/title.txt

@@ -0,0 +1,2 @@
+% RePractise
+% Phodal Huang

+ 0 - 0
chapters/00-prelude.md


+ 0 - 0
chapters/01-introduction.md


+ 157 - 0
epub.css

@@ -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
img/cover.jpg


+ 28 - 0
index.html

@@ -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>RePractise - </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>RePractise</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>

BIN
repractise.epub


+ 0 - 0
repractise.md


BIN
repractise.pdf


+ 6 - 0
repractise.rtf

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