Permalink
Browse files

updated site and docs

  • Loading branch information...
1 parent 473438f commit cef2811f972796c18ba2663ab9eaa9ea68f798f7 @jgallen23 committed Mar 6, 2012
Showing with 25 additions and 13 deletions.
  1. +3 −0 .gitmodules
  2. +5 −9 Makefile
  3. +16 −4 docs/index.md
  4. +1 −0 site
View
@@ -0,0 +1,3 @@
+[submodule "site"]
+ path = site
+ url = git@github.com:jgallen23/clientjade.git
View
@@ -1,13 +1,9 @@
-#SRC =
-TEST = test/*.js
-REPORTER = list
+site: docs/index.md example/
+ @cd site; ../node_modules/.bin/markx --head layout/head.html --foot layout/foot.html ../docs/index.md > index.html
+ @cp -r example site/
-
-site : docs/index.md
- @./node_modules/.bin/markx --lang javascript docs/index.md | cat site/layout/head.html - site/layout/foot.html > site/index.html
-
-preview-docs:
- @./node_modules/.bin/markx --lang javascript --preview 8001 docs/index.md
+preview-site:
+ @cd site; ../node_modules/.bin/markx --preview 8001 --head layout/head.html --foot layout/foot.html ../docs/index.md
preview-readme:
@./node_modules/.bin/markx --preview 8001 README.md
View
@@ -1,6 +1,6 @@
# ClientJade
-clientjade is a command line tool to compile your jade templates into client side templates for use in the browser.
+clientjade is a command line tool to compile your jade templates into client side templates for use in the browser. It will automatically include everything you need to render the templates, no need to include jade.js or runtime.js.
##Installation
@@ -20,10 +20,12 @@ clientjade is a command line tool to compile your jade templates into client sid
Examples:
# compile jade files into js
- $ clientjade test1.jade test2.jade > jade.js
+ $ clientjade test1.jade test2.jade > templates.js
##Example
+Lets say you have two templates, test1.jade and test2.jade, that need to be used on the client side.
+
test1.jade
p Hello, my name is #{name}
@@ -34,17 +36,27 @@ test2.jade
each item in items
li= item
-include the output js file in your html and then all you need to do is call this:
+All you need to do is run:
+
+ $ clientjade test1.jade test2.jade > templates.js
+
+And then include template.js file in your html.
+
+To render the templates, just make a call like this:
//jade.render(domNode, templateName, data);
jade.render(document.getElementById('test1'), 'test1', { name: 'Bob' });
jade.render(document.getElementById('test2'), 'test2', { items: ['item1', 'item2', 'item3'] });
+### Live Example
+
+You can check out a live example [here](/example/)
+
##History
-###0.0.1 (03/06/2012)
+###0.0.1
- initial commit
##Future
1 site
Submodule site added at 22fb33

0 comments on commit cef2811

Please sign in to comment.