Skip to content
This repository has been archived by the owner on Jan 28, 2022. It is now read-only.

Commit

Permalink
more readme tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
grippy committed May 25, 2012
1 parent 21776dc commit ac0ce16
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Jade Browser

Middleware for express/connect to expose jade templates to the web browser. It provides a few additional features like express-like render function with partial handling.
Middleware for express/connect and/or static file generator to expose jade templates to the web browser.
It provides a few additional features like express-like render function with partial handling.

```javascript
var express = require('express')
Expand All @@ -17,7 +18,7 @@ app.use(jade_browser(url_endpoint, template_dir, options));
## Features

* Jade templates are served as compiled functions.
* either as middleware or cached and served from a public directory
* either as middleware or pre-cached and served from a public directory
* removes browser compatibility issues
* increases speed of template execution
* reduces file transfer size
Expand All @@ -42,8 +43,7 @@ var express = require('express')
app.use(jade_browser.middleware('/js/templates.js', '**', options));

```

Or, configure to add static file caching, instead.
Or, configure to add static file caching -- with or without express/connect.

```javascript
var jade_browser = require('jade-browser')
Expand All @@ -52,7 +52,9 @@ var jade_browser = require('jade-browser')
jade_browser.cache('/js/templates.js', '**',
{root: 'some/directory/with/views', staticRoot: __dirname + '/public'});

// or configure the file watcher and add static file caching
// or, configure the file watcher and add static file caching
// you'll need to manually create the folder where the files should live
// to compile, just save one of the files listed in the directory.
if (env === 'development') {
jade_browser.watch('/js/templates.js', '**',
{root: 'some/directory/with/views', staticRoot: __dirname + '/public'});
Expand Down

0 comments on commit ac0ce16

Please sign in to comment.