mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Minor updates
This commit is contained in:
parent
f473f6a422
commit
b56edf51b7
@ -101,6 +101,7 @@ The template can then be rendered as shown in the following sample code:
|
|||||||
```javascript
|
```javascript
|
||||||
var templatePath = require.resolve('./hello.rhtml');
|
var templatePath = require.resolve('./hello.rhtml');
|
||||||
var template = require('raptor-templates').load(templatePath);
|
var template = require('raptor-templates').load(templatePath);
|
||||||
|
|
||||||
template.render({
|
template.render({
|
||||||
name: 'World',
|
name: 'World',
|
||||||
colors: ["red", "green", "blue"]
|
colors: ["red", "green", "blue"]
|
||||||
@ -206,6 +207,7 @@ npm install raptor-templates --global
|
|||||||
### Callback API
|
### Callback API
|
||||||
```javascript
|
```javascript
|
||||||
var template = require('raptor-templates').load('template.rhtml');
|
var template = require('raptor-templates').load('template.rhtml');
|
||||||
|
|
||||||
template.render({
|
template.render({
|
||||||
name: 'Frank',
|
name: 'Frank',
|
||||||
count: 30
|
count: 30
|
||||||
@ -239,6 +241,7 @@ template.stream({
|
|||||||
```javascript
|
```javascript
|
||||||
var raptorTemplates = require('raptor-templates');
|
var raptorTemplates = require('raptor-templates');
|
||||||
var template = raptorTemplates.load('template.rhtml');
|
var template = raptorTemplates.load('template.rhtml');
|
||||||
|
|
||||||
var out = require('fs').createWriteStream('index.html', 'utf8');
|
var out = require('fs').createWriteStream('index.html', 'utf8');
|
||||||
|
|
||||||
var context = raptorTemplates.createContext(out);
|
var context = raptorTemplates.createContext(out);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user