Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed TOC, PDF header and added require("assert") to examples.

  • Loading branch information...
commit 51c0401619f76d5419e590c9c51420ac9f953ebd 1 parent 5ca5c30
Assaf Arkin authored
9 Cakefile
View
@@ -71,7 +71,7 @@ task "test", "Run all tests", -> runTests onerror
# Markdown to HTML.
toHTML = (source, callback)->
target = "html/#{path.basename(source, ".md").toLowerCase()}.html"
- fs.readFile "doc/_layout.html", "utf8", (err, layout)->
+ fs.readFile "doc/layout/main.html", "utf8", (err, layout)->
onerror err
fs.readFile source, "utf8", (err, text)->
onerror err
@@ -100,7 +100,7 @@ documentPages = (callback)->
html = html.replace(/<h1>(.*)<\/h1>/, "<h1>Zombie.js</h1><b>$1</b>")
fs.writeFile "html/index.html", html, "utf8", onerror
fs.unlink "html/readme.html", onerror
- exec "cp -f doc/*.css html/", callback
+ exec "cp -fr doc/css doc/images html/", callback
convert()
documentSource = (callback)->
@@ -132,9 +132,10 @@ generateMan = (callback)->
generatePDF = (callback)->
log "Generating PDF documentation ...", green
files = "index api selectors troubleshoot".split(" ").map((f)-> "html/#{f}.html")
- options = "--book --disable-javascript --outline --print-media-type --title Zombie.js --header-html doc/_header.html --cover doc/cover.html"
+ options = "--disable-javascript --outline --print-media-type --title Zombie.js --header-html doc/layout/header.html"
+ toc = "--toc --toc-depth 2 --toc-no-dots --cover doc/layout/cover.html --allow doc/images --outline"
margins = "--margin-left 20 --margin-right 20 --margin-top 20 --margin-bottom 20 --header-spacing 5"
- exec "wkhtmltopdf #{options} #{margins} #{files.join(" ")} html/zombie.pdf", callback
+ exec "wkhtmltopdf #{options} #{margins} #{toc} #{files.join(" ")} html/zombie.pdf", callback
generateDocs = (callback)->
log "Generating documentation ...", green
1  README.md
View
@@ -13,6 +13,7 @@ a simulated environment. No browser required.
Let's try to sign up to a page and see what happens:
var zombie = require("zombie");
+ var assert = require("assert");
// Load the page from localhost
zombie.visit("http://localhost:3000/", function (err, browser) {
2  doc/print.css → doc/css/print.css
View
@@ -3,7 +3,7 @@ body {
font-size: 12pt;
margin: 2em 4em;
}
-h1, h2, h3, h4, #header {
+h1, h2, h3, h4, #header, .header {
font-family: "Gill Sans", "Gill Sans MT", Calibri, sans-serif;
}
h1 { font-size: 18pt; }
0  doc/screen.css → doc/css/screen.css
View
File renamed without changes
0  doc/zombie.png → doc/images/zombie.png
View
File renamed without changes
6 doc/cover.html → doc/layout/cover.html
View
@@ -14,7 +14,7 @@
color: #600;
font-size: 48pt;
}
- img {
+ .image {
width: 500px;
margin: 24px auto;
}
@@ -22,7 +22,9 @@
</head>
<body>
<h1>Zombie.js</h1>
- <img src="zombie.png" width="500" height="375">
+ <div class="image">
+ <img src="../images/zombie.png" width="500" height="375">
+ </div>
<h2>Insanely fast, full-stack, headless browser testing</h2>
</body>
</html>
1  doc/_header.html → doc/layout/header.html
View
@@ -18,7 +18,6 @@
font-size: 10pt;
margin: 0;
padding: 0;
- border-bottom: 1px solid #ccc;
width: 100%;
}
</style>
20 doc/_layout.html → doc/layout/main.html
View
@@ -2,8 +2,8 @@
<html>
<head>
<title>{{title}}</title>
- <link href="screen.css" media="screen,projection" rel="stylesheet" type="text/css">
- <link href="print.css" media="print" rel="stylesheet" type="text/css">
+ <link href="css/screen.css" media="screen,projection" rel="stylesheet" type="text/css">
+ <link href="css/print.css" media="print" rel="stylesheet" type="text/css">
</head>
<body>
<div id="header">
@@ -12,16 +12,16 @@
<div id="sidebar">
<ul class="navigation">
<li><a href="/">Getting Started</a></li>
- <li><a href="/api.html">The API</a></li>
- <li><a href="/selectors.html">CSS Selectors</a></li>
- <li><a href="/troubleshoot.html">Troubleshooting</a></li>
- <li><a href="/guts.html">The Guts</a></li>
- <li><a href="/changelog.html">Changelog</a></li>
- <li><a href="/zombie.pdf">Download PDF</a></li>
+ <li><a href="api.html">The API</a></li>
+ <li><a href="selectors.html">CSS Selectors</a></li>
+ <li><a href="troubleshoot.html">Troubleshooting</a></li>
+ <li><a href="guts.html">The Guts</a></li>
+ <li><a href="changelog.html">Changelog</a></li>
+ <li><a href="zombie.pdf">Download PDF</a></li>
<li>&nbsp;</li>
<li><a href="http://www.w3.org/DOM/DOMTR">DOM API</a></li>
- <li><a href="/source/">Annotated Source</a></li>
- <li><a href="/todo.html">Todo</a></li>
+ <li><a href="source/">Annotated Source</a></li>
+ <li><a href="todo.html">Todo</a></li>
<li><a href="https://github.com/assaf/zombie">Github/Issues</a></li>
</ul>
<div class="donate">
Please sign in to comment.
Something went wrong with that request. Please try again.