Updated README.md

This commit is contained in:
Patrick Steele-Idem 2014-03-24 20:59:40 -06:00
parent 4c206967ad
commit 5267397a63

View File

@ -3,19 +3,17 @@ raptor-templates
<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** - [Overview](#overview)
- [Overview](#raptor-templates)
- [Sample Templates](#sample-templates) - [Sample Templates](#sample-templates)
- [Installation](#installation) - [Installation](#installation)
- [Usage](#usage) - [Usage](#usage)
- [Template Rendering](#template-rendering) - [Template Rendering](#template-rendering)
- [Callback API](#callback-api) - [Callback API](#callback-api)
- [Streaming API](#streaming-api) - [Streaming API](#streaming-api)
- [Template Compilation](#template-compilation)
- [Browser-side Rendering](#browser-side-rendering) - [Browser-side Rendering](#browser-side-rendering)
- [Using the RaptorJS Optimizer](#using-the-raptorjs-optimizer) - [Using the RaptorJS Optimizer](#using-the-raptorjs-optimizer)
- [Using Browserify](#using-browserify) - [Using Browserify](#using-browserify)
- [Template Compilation](#template-compilation)
<!-- END doctoc generated TOC please keep comment here to allow auto update --> <!-- END doctoc generated TOC please keep comment here to allow auto update -->
@ -86,9 +84,9 @@ raptorTemplates.render('template.rhtml', {
### Streaming API ### Streaming API
```javascript ```javascript
var raptorTemplates = require('raptor-templates'); var raptorTemplates = require('raptor-templates');
var out = require('fs').createWriteStream('template.html', 'utf8'); var out = require('fs').createWriteStream('index.html', 'utf8');
// Render the template to 'template.rhtml' // Render the template to 'index.html'
raptorTemplates raptorTemplates
.stream('template.rhtml', { .stream('template.rhtml', {
name: 'Frank', name: 'Frank',
@ -153,7 +151,7 @@ This will produce a file named `hello.rhtml.js` next to the original file.
You can also compile multiple templates using a glob pattern as shown in the following sample command: You can also compile multiple templates using a glob pattern as shown in the following sample command:
```bash ```bash
rhtmlc **/*.rhtml rhtmlc src/**/*.rhtml
``` ```
Alternatively, you can use the JavaScript API to compile a module as shown in the following sample code: Alternatively, you can use the JavaScript API to compile a module as shown in the following sample code: