more formatting work

This commit is contained in:
Mark McGranaghan 2012-10-02 09:52:24 -07:00
parent f6b63e5f2b
commit eb9cf61d06
2 changed files with 28 additions and 21 deletions

View File

@ -1,11 +1,11 @@
/* PDF Formatting */ /* PDF Formatting */
@page { margin: 10px 10px 10px 10px } @page { margin: 48px 0px 48px 0px }
/*--------------------- Layout and Typography ----------------------------*/ /* Layout and Typography */
body { body {
font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;
font-size: 14px; font-size: 12px;
line-height: 20px; line-height: 16px;
color: #252519; color: #252519;
margin: 0; padding: 0; margin: 0; padding: 0;
} }
@ -19,38 +19,46 @@ p {
margin: 0; margin: 0;
} }
h1, h2, h3, h4, h5, h6 { h1, h2, h3, h4, h5, h6 {
margin: 30px 0 15px 0; margin: 24px 0 12px 0;
font-weight: normal;
}
h2 {
font-size: 24px;
} }
hr { hr {
border: 0 none; border: 0 none;
border-top: 1px solid #e5e5ee; border-top: 1px solid #e5e5ee;
height: 1px; height: 1px;
margin: 20px 0; margin: 16px 0;
}
#container {
position: relative;
} }
table { table {
page-break-inside: avoid; page-break-inside: avoid;
width: 775px; width: 690px;
min-width: 690px;
max-width: 690px;
margin-left: auto;
margin-right: auto;
margin-bottom: 32px;
} }
table td { table td {
border: 0; border: 0;
outline: 0; outline: 0;
} }
td.docs { td.docs {
max-width: 350px; width: 330px;
min-width: 350px; max-width: 330px;
min-width: 330px;
min-height: 5px; min-height: 5px;
padding: 10px 15px 1px 30px; padding: 5px 5px 5px 5px;
overflow-x: hidden; overflow-x: hidden;
vertical-align: top; vertical-align: top;
text-align: left; text-align: left;
} }
td.code { td.code {
max-width: 400px; width: 360px;
min-width: 400px; max-width: 360px;
padding: 10px 10px 10px 10px; min-width: 360px;
padding: 5px 5px 5px 5px;
vertical-align: top; vertical-align: top;
background: #f0f0f0; background: #f0f0f0;
} }
@ -59,13 +67,13 @@ td.code.empty {
background: #ffffff; background: #ffffff;
} }
pre, code { pre, code {
font-size: 11px; line-height: 16px; font-size: 10px; line-height: 14px;
font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace; font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace;
margin: 0; padding: 0; margin: 0; padding: 0;
} }
/*---------------------- Syntax Highlighting -----------------------------*/ /* Syntax Highlighting */
td.linenos { background-color: #f0f0f0; padding-right: 10px; } td.linenos { background-color: #f0f0f0; padding-right: 10px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; } span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
body .hll { background-color: #ffffcc } body .hll { background-color: #ffffcc }

View File

@ -173,8 +173,7 @@ func main() {
<title>Go by Example</title> <title>Go by Example</title>
<link rel=stylesheet href="../style/book.css"> <link rel=stylesheet href="../style/book.css">
</head> </head>
<body> <body>`)
<div id="container">`)
chapterPaths := mustGlob("./src/0*") chapterPaths := mustGlob("./src/0*")
for _, chapterPath := range chapterPaths { for _, chapterPath := range chapterPaths {
fmt.Print(`<table cellspacing="0" cellpadding="0"><tbody>`) fmt.Print(`<table cellspacing="0" cellpadding="0"><tbody>`)
@ -195,5 +194,5 @@ func main() {
} }
fmt.Print(`</tbody></table>`) fmt.Print(`</tbody></table>`)
} }
fmt.Print(`</div></body></html>`) fmt.Print(`</body></html>`)
} }