Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

init repos

  • Loading branch information...
commit eddf37681b2e420c7c62e95c0bea4420b9199a01 1 parent d715e1c
@leeight authored
View
4 README.md
@@ -1,2 +1,4 @@
kindle
-======
+======
+
+Using <http://www.princexml.com> to generate kindle friendly pdf.
View
97 kindle.css
@@ -0,0 +1,97 @@
+/***************************************************************************
+ *
+ * Copyright (c) 2012 Baidu.com, Inc. All Rights Reserved
+ * $Id$
+ *
+ **************************************************************************/
+
+
+
+/**
+ * kindle.css ~ 2012/06/09 14:22:03
+ * @author leeight(liyubei@baidu.com)
+ * @version $Revision$
+ * @description
+ *
+ **/
+
+
+
+@page {
+ /** Kindle 6 inch */
+ size: 9.12cm 12.16cm;
+ margin: 20pt 15pt 20pt 15pt;
+
+ @top-right {
+ content: "这里是每页的表头";
+ vertical-align: bottom;
+ font-size: 50%;
+ border-bottom: 1px solid black;
+ }
+
+ @bottom-right {
+ content: counter(page);
+ font-style: italic;
+ font-size: 50%;
+ }
+
+ @footnotes {
+ border-top: 1px solid black;
+ }
+}
+
+
+@font-face {
+ font-family: arial;
+ src: local("Times New Roman");
+}
+
+@font-face {
+ font-family: sans-serif;
+ src: local("WenQuanYi Micro Hei");
+}
+
+@font-face {
+ font-family: monospace;
+ src: local("Ubuntu Mono");
+}
+
+.chapter {
+ counter-reset: footnote;
+}
+
+.fn {
+ float: footnote;
+ font-size: 50%;
+ font-family: Georgia;
+ footnote-style-position: inside;
+}
+.fn::footnote-call {
+ content: "[" counter(footnote) "]";
+ vertical-align: super;
+ line-height: none;
+ font-size: 80%;
+}
+.fn::footnote-marker {
+ /** TODO */
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/* vim: set ts=4 sw=4 sts=4 tw=100 noet: */
View
30 kindle.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+ <title>Kindle Test Page</title>
+ <link rel="stylesheet" type="text/css" href="kindle.css" />
+ <link rel="stylesheet" type="text/css" href="typography.css" />
+ </head>
+ <body>
+ <p>1234567890</p>
+ <p>abcdefghijklmnopqrstuvwxyz</p>
+ <p>ABCDEFGHIJKLMNOPQRSTUVWXYZ</p>
+ <p>这是一个测试的页面</p>
+ <p>
+ Footnotes<span class="fn">A footnote is a note placed at
+ the bottom of a page of a book or manuscript that comments on or
+ cites a reference for a designated part of the text.</span> are
+ essential in printed documents and Prince knows how to generate
+ them. Most readers will read the footnotes before they read the text
+ from where the footnotes are anchored<span class="fn">中文的脚注.</span>.
+ </p>
+ <h1>登金陵凤凰台</h1>
+ <p>
+ 凤凰台上凤凰游,凤去台空江自流。<br>
+ 吴宫花草埋幽径,晋代衣冠成古丘。<br>
+ 三山半落青天外,二水中分白鹭洲。<br>
+ 总为浮云能蔽日,长安不见使人愁。<br>
+ </p>
+ </body>
+</html>
View
BIN  kindle.pdf
Binary file not shown
View
123 typography.css
@@ -0,0 +1,123 @@
+/* --------------------------------------------------------------
+
+ typography.css
+ * Sets up some sensible default typography.
+
+-------------------------------------------------------------- */
+
+/* Default font settings.
+ The font-size percentage is of 16px. (0.875 * 16px = 14px) */
+html { font-size:100.01%; }
+body {
+ font-size: 87.5%;
+ color: #222;
+ background: #fff;
+ font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
+}
+
+
+/* Headings
+-------------------------------------------------------------- */
+
+h1,h2,h3,h4,h5,h6 { font-weight: normal; color: #111; }
+
+h1 { font-size: 3em; line-height: 1; margin-bottom: 0.5em; }
+h2 { font-size: 2em; margin-bottom: 0.75em; }
+h3 { font-size: 1.5em; line-height: 1; margin-bottom: 1em; }
+h4 { font-size: 1.2em; line-height: 1.25; margin-bottom: 1.25em; }
+h5 { font-size: 1em; font-weight: bold; margin-bottom: 1.5em; }
+h6 { font-size: 1em; font-weight: bold; }
+
+h1 img, h2 img, h3 img,
+h4 img, h5 img, h6 img {
+ margin: 0;
+}
+
+
+/* Text elements
+-------------------------------------------------------------- */
+
+p { margin: 0 0 1.5em; }
+/*
+ These can be used to pull an image at the start of a paragraph, so
+ that the text flows around it (usage: <p><img class="left">Text</p>)
+ */
+.left { float: left !important; }
+p .left { margin: 1.5em 1.5em 1.5em 0; padding: 0; }
+.right { float: right !important; }
+p .right { margin: 1.5em 0 1.5em 1.5em; padding: 0; }
+
+a:focus,
+a:hover { color: #09f; }
+a { color: #06c; text-decoration: underline; }
+
+blockquote { margin: 1.5em; color: #666; font-style: italic; }
+strong,dfn { font-weight: bold; }
+em,dfn { font-style: italic; }
+sup, sub { line-height: 0; }
+
+abbr,
+acronym { border-bottom: 1px dotted #666; }
+address { margin: 0 0 1.5em; font-style: italic; }
+del { color:#666; }
+
+pre { margin: 1.5em 0; white-space: pre; }
+pre,code,tt { font: 1em 'andale mono', 'lucida console', monospace; line-height: 1.5; }
+
+
+/* Lists
+-------------------------------------------------------------- */
+
+li ul,
+li ol { margin: 0; }
+ul, ol { margin: 0 1.5em 1.5em 0; padding-left: 1.5em; }
+
+ul { list-style-type: disc; }
+ol { list-style-type: decimal; }
+
+dl { margin: 0 0 1.5em 0; }
+dl dt { font-weight: bold; }
+dd { margin-left: 1.5em;}
+
+
+/* Tables
+-------------------------------------------------------------- */
+
+/*
+ Because of the need for padding on TH and TD, the vertical rhythm
+ on table cells has to be 27px, instead of the standard 18px or 36px
+ of other elements.
+ */
+table { margin-bottom: 1.4em; width:100%; }
+th { font-weight: bold; }
+thead th { background: #c3d9ff; }
+th,td,caption { padding: 4px 10px 4px 5px; }
+/*
+ You can zebra-stripe your tables in outdated browsers by adding
+ the class "even" to every other table row.
+ */
+tbody tr:nth-child(even) td,
+tbody tr.even td {
+ background: #e5ecf9;
+}
+tfoot { font-style: italic; }
+caption { background: #eee; }
+
+
+/* Misc classes
+-------------------------------------------------------------- */
+
+.small { font-size: .8em; margin-bottom: 1.875em; line-height: 1.875em; }
+.large { font-size: 1.2em; line-height: 2.5em; margin-bottom: 1.25em; }
+.hide { display: none; }
+
+.quiet { color: #666; }
+.loud { color: #000; }
+.highlight { background:#ff0; }
+.added { background:#060; color: #fff; }
+.removed { background:#900; color: #fff; }
+
+.first { margin-left:0; padding-left:0; }
+.last { margin-right:0; padding-right:0; }
+.top { margin-top:0; padding-top:0; }
+.bottom { margin-bottom:0; padding-bottom:0; }

0 comments on commit eddf376

Please sign in to comment.
Something went wrong with that request. Please try again.