Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finish initial docs and add with hack to eval line
- Loading branch information
1 parent
572142a
commit b2bbab1
Showing
4 changed files
with
102 additions
and
13 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
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
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,14 @@ | ||
!!! XML | ||
!!! strict | ||
%html{ xmlns: "http://www.w3.org/1999/xhtml" } | ||
%head | ||
%title | ||
Sample haml template | ||
%body | ||
.profile | ||
.left.column | ||
#date= print_date() | ||
#address= current_user.address | ||
.right.column | ||
#email= current_user.email | ||
#bio= current_user.bio |
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,26 @@ | ||
// Requires nodeJS 0.1.13 or greater to run <http://nodejs.org/> | ||
// just type `node test.js` on the command line | ||
|
||
// Load the puts function and friends | ||
node.mixin(require("/utils.js")); | ||
|
||
// Load the haml-js library from the current directory | ||
var Haml = require("haml.js"); | ||
|
||
// Set up a scope for our view to render in | ||
var scope = { | ||
print_date: function () { | ||
return (new Date()).toDateString(); | ||
}, | ||
current_user: { | ||
address: "Richardson, TX", | ||
email: "tim@creationix.com", | ||
bio: "Experienced software professional..." | ||
} | ||
}; | ||
|
||
|
||
// Load, parse, and render the html. The result it passed to the callback puts | ||
// which prints it to the terminal. | ||
Haml.render(scope, "test.haml", puts); | ||
|