Permalink
Browse files

added functionality

  • Loading branch information...
1 parent 1fc5a95 commit 39f3ebe4827cdc479c81f84d2d1e3b3a5eb11fc7 @shimondoodkin committed Jun 26, 2010
Showing with 8 additions and 5 deletions.
  1. +7 −4 README.md
  2. +1 −1 doubletemplate.js
View
@@ -75,17 +75,20 @@ A template that processed twice:
var te = require('doubletemplate'); //load double teplate module
var doubletemplate=te.doubletemplate; // export double template function to global
-### example of useing `parsedir` function:
+### example of using `parsedir` function:
te.parsedir(__dirname+'/templates',{'app':app});
-### example of useing `loadfile` function:
+### example of using `loadfile` function:
te.loadfile(__dirname+'/templates/filename.html',{'app':app},__dirname);
### in the code you can use:
- te.templates['subdir/filename.html']({'app':app});
+ te.templates['subdir/filename.html']({name:'your name'});
-the code is in stright forward logic you can read it and understand how it works.
+### example of using `loadtemplate` function:
+ var mytemplate=te.loadtemplate(__dirname+'/templates/filename.html',{'app':app});
+ mytemplate({name:'your name'});
+the code is in stright forward logic you can read it and understand how it works.
### todo:
* to add parsing of first ; position for output shortcut tag to allow easyier convertion to non bloking style if needed.
View
@@ -367,5 +367,5 @@ function loadfile(file,dataobject,basedir)
/////////
function loadtemplate(file,dataobject)
{
- return doubletemplate(fs.readFileSync(file_on_callback),dataobject);
+ return doubletemplate(fs.readFileSync(file),dataobject);
}this.loadtemplate=loadtemplate;

0 comments on commit 39f3ebe

Please sign in to comment.