forked from sintaxi/harp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cb21ee0
commit 94a04e2
Showing
23 changed files
with
237 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Example Harp App | ||
================== | ||
|
||
This app exposes a lot of the functionality that Harp offers. Browse the code and take a look. Questions may be asked in the #harp IRC channel on irc.freenode.net. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"globals": { | ||
"brand" : "Kitchen Sink", | ||
"name" : "Brock Whitten", | ||
"email" : "[email protected]", | ||
"uri" : "http://example.com" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
doctype | ||
html | ||
head | ||
style. | ||
body{ | ||
text-align:center; | ||
font-family: "verdana"; | ||
} | ||
body | ||
h1 404 | ||
h2 Custom, Page Not Found |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"404":{ | ||
"layout": false | ||
}, | ||
"feed":{ | ||
"layout": false | ||
}, | ||
"globals":{ | ||
"layout": false | ||
}, | ||
"current":{ | ||
"layout": false | ||
}, | ||
"about": { | ||
"name": "Brock" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
doctype | ||
html | ||
head | ||
link(rel="stylesheet", href="/css/main.css") | ||
link(rel="alternate", type="application/atom+xml", title="#{ brand }", href="#{ uri }/feed.atom") | ||
script. | ||
var showDebug = function(){ | ||
document.getElementById('debug').style.display = 'block'; | ||
return false; | ||
} | ||
body | ||
#header | ||
h1= brand | ||
include shared/_nav | ||
!= yield | ||
a(href="#", onclick="showDebug()") open debug panel | ||
.well#debug(style="display:none;") | ||
!= partial("shared/_debug") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
h2 About #{ name } | ||
p Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"hello-world" : { | ||
"title" : "Hello World", | ||
"date" : "May 2, 2012" | ||
}, | ||
"you-half-assed-it" : { | ||
"title" : "You half assed it. That is why your PhoneGap application sucks.", | ||
"date" : "June 6, 2012" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
h2 | ||
a(href="/articles/hello-world") Hello World | ||
h3= date | ||
p Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. | ||
|
||
//!= partial("../shared/_debug") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
h2 Articles | ||
each article, slug in public.articles._data | ||
hr | ||
!= partial(slug, article) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
foo article with spaces |
6 changes: 6 additions & 0 deletions
6
test/apps/compile/basic/public/articles/you-half-assed-it.jade
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
h2 | ||
a(href="/articles/you-half-assed-it") You Half assed it | ||
h3= date | ||
p Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. | ||
|
||
//!= partial("../shared/_debug") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h1>Basic HTML Page</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#header { | ||
|
||
h1 { | ||
font-size: 26px; | ||
font-weight: bold; | ||
} | ||
|
||
ul{ | ||
list-style-type: none; | ||
padding:0; | ||
li{ | ||
display: inline-block; | ||
margin-right: 20px; | ||
a { | ||
padding: 10px 5px; | ||
} | ||
} | ||
li.current a{ | ||
background: pink; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#header { | ||
|
||
h1 { | ||
font-size: 26px; | ||
font-weight: bold; | ||
} | ||
|
||
ul{ | ||
list-style-type: none; | ||
padding:0; | ||
li{ | ||
display: inline-block; | ||
margin-right: 20px; | ||
a { | ||
padding: 10px 5px; | ||
} | ||
} | ||
li.current a{ | ||
background: pink; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
body { | ||
background: red; | ||
&:before { | ||
contents: "Chloi Inc." | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@import "_nav"; | ||
|
||
body{ | ||
font-family: "Verdana" | ||
} | ||
|
||
.well{ | ||
background: #eee; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
h2 Home | ||
p Welcome to Harp. This basic app is a domonstration of how harp works. Poke around and enjoy. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
h4 globals | ||
pre= JSON.stringify(locals, null, 2) | ||
|
||
h4 current | ||
pre= JSON.stringify(current, null, 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ul | ||
li(class="#{ current.path[0] == 'index' ? 'current' : '' }") | ||
a(href="/") Home | ||
li(class="#{ current.path[0] == 'articles' ? 'current' : '' }") | ||
a(href="/articles") Articles | ||
li(class="#{ current.path[0] == 'about' ? 'current' : '' }") | ||
a(href="/about") About | ||
li | ||
a(href="/feed.atom") RSS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
html | ||
head | ||
title Hi | ||
link(href="b.css" rel="stylesheet" type="text/css") | ||
body | ||
h1 Hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
body { | ||
background: $indigo | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
0 info it worked if it ends with ok | ||
1 verbose cli [ 'node', '/usr/local/bin/npm', 'test' ] | ||
2 info using [email protected] | ||
3 info using [email protected] | ||
4 verbose node symlink /usr/bin/node | ||
5 error Error: ENOENT, open '/Users/kennethormandy/Sites/kennethormandy/harp/test/apps/compile/err/package.json' | ||
6 error If you need help, you may report this log at: | ||
6 error <http://github.com/isaacs/npm/issues> | ||
6 error or email it to: | ||
6 error <[email protected]> | ||
7 error System Darwin 12.5.0 | ||
8 error command "node" "/usr/local/bin/npm" "test" | ||
9 error cwd /Users/kennethormandy/Sites/kennethormandy/harp/test/apps/compile/err | ||
10 error node -v v0.10.18 | ||
11 error npm -v 1.3.8 | ||
12 error path /Users/kennethormandy/Sites/kennethormandy/harp/test/apps/compile/err/package.json | ||
13 error code ENOENT | ||
14 error errno 34 | ||
15 verbose exit [ 34, true ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
var should = require("should") | ||
var request = require('request') | ||
var path = require("path") | ||
var fs = require("fs") | ||
var exec = require("child_process").exec | ||
var harp = require("../"); | ||
|
||
describe("compile", function(){ | ||
|
||
describe("basic app", function(){ | ||
var projectPath = path.join(__dirname, "apps/compile/basic") | ||
var outputPath = path.join(__dirname, "out/compile-basic") | ||
|
||
it("should compile", function(done){ | ||
harp.compile(projectPath, outputPath, function(error){ | ||
should.not.exist(error) | ||
done() | ||
}) | ||
}) | ||
|
||
it("compile should not include files named with underscores", function(done) { | ||
var cssOutputPath = path.join(outputPath, "public/css") | ||
fs.readFile(path.join(cssOutputPath, "/_partials/some.css"), function(err, contents){ | ||
should.not.exist(contents) | ||
}) | ||
fs.readFile(path.join(cssOutputPath, "/_partials/_more.css"), function(err, contents){ | ||
should.not.exist(contents) | ||
}) | ||
fs.readFile(path.join(cssOutputPath, "/_nav.css"), function(err, contents){ | ||
should.not.exist(contents) | ||
}) | ||
done() | ||
}) | ||
|
||
}) | ||
|
||
after(function(done){ | ||
exec("rm -rf " + path.join(__dirname, "out"), function(){ | ||
done() | ||
}) | ||
}) | ||
|
||
}) |