{"_id":"kally-razor","_rev":"39-a4237bd437e84e5b95c5a6924637c760","name":"kally-razor","description":"Razor engine for Node","dist-tags":{"latest":"0.3.10"},"versions":{"0.0.1":{"name":"kally-razor","version":"0.0.1","description":"Razor engine for Node","main":"main.js","directories":{"test":"test"},"scripts":{"test":"mocha test/*.js"},"repository":{"type":"git","url":"git://github.com/nufyoot/kally-razor.git"},"keywords":["razor","node","kally-razor","kally"],"devDependencies":{"chai":"*","mocha":"*"},"dependencies":{"express":"3.x"},"author":{"name":"Terry Tice","email":"nufyoot@gmail.com"},"readme":"kally-razor\n===========\n\n[![Build Status](https://travis-ci.org/nufyoot/kally-razor.png?branch=master)](https://travis-ci.org/nufyoot/kally-razor)\n\nLooking for an awesome Razor engine for Node.  Why not roll your own?  That's my plan...\n","readmeFilename":"README.md","_id":"kally-razor@0.0.1","dist":{"shasum":"5c1e5c61b804e99a94bba72918494cf630a73cb5","tarball":"https://registry.npmjs.org/kally-razor/-/kally-razor-0.0.1.tgz","integrity":"sha512-8ZMSCTi54udcC2A2eUpHHSriT1WXsV8mtB7/MNTf1kLBfP+7HhmvmVeBBOB9BBibqI8zgG5baktIaGycHuDK1Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICoL2lTcIO+Jj5egFn2uNUH+98euH9LNafH6HHsY+C5zAiEAggj9ExWF6UMszTA2Gyxj27JZgoovAVAH4eJnoqXRl+w="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"nufyoot","email":"nufyoot@gmail.com"},"maintainers":[{"name":"nufyoot","email":"nufyoot@gmail.com"}]},"0.0.2":{"name":"kally-razor","version":"0.0.2","description":"Razor engine for Node","main":"lib/main.js","directories":{"test":"test"},"scripts":{"test":"mocha test/*.js"},"repository":{"type":"git","url":"git://github.com/nufyoot/kally-razor.git"},"keywords":["razor","node","kally-razor","kally"],"devDependencies":{"chai":"*","mocha":"*"},"dependencies":{"express":"3.x"},"author":{"name":"Terry Tice","email":"nufyoot@gmail.com"},"readme":"kally-razor\n===========\n\n[![Build Status](https://travis-ci.org/nufyoot/kally-razor.png?branch=master)](https://travis-ci.org/nufyoot/kally-razor)\n\nLooking for an awesome Razor engine for Node.  Why not roll your own?  That's my plan...\n","readmeFilename":"README.md","_id":"kally-razor@0.0.2","dist":{"shasum":"333aaed5307366e1e6a32c1846810f683a4bd435","tarball":"https://registry.npmjs.org/kally-razor/-/kally-razor-0.0.2.tgz","integrity":"sha512-EsjCK5cWA2Z+xveEv6w1HfzZltb5zv05SI0xesZT2rVayXL3xlcEvhffmegZXr+NnQpCH+7eb4RQ+tLQgX0MhA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgYcUHOud3ME66EEeJZHzqNXhe+9Xjit72NQ1ktV1/uwIgLo7l+UzlRw+4rdgygAFXIuOJX0BNvooGt2cE7q4n79A="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"nufyoot","email":"nufyoot@gmail.com"},"maintainers":[{"name":"nufyoot","email":"nufyoot@gmail.com"}]},"0.0.3":{"name":"kally-razor","version":"0.0.3","description":"Razor engine for Node","main":"lib/main.js","directories":{"test":"test"},"scripts":{"test":"mocha test/*.js"},"repository":{"type":"git","url":"git://github.com/nufyoot/kally-razor.git"},"keywords":["razor","node","kally-razor","kally"],"devDependencies":{"chai":"*","mocha":"*"},"dependencies":{"express":"3.x"},"author":{"name":"Terry Tice","email":"nufyoot@gmail.com"},"readme":"kally-razor\n===========\n\n[![Build Status](https://travis-ci.org/nufyoot/kally-razor.png?branch=master)](https://travis-ci.org/nufyoot/kally-razor)\n\nLooking for an awesome Razor engine for Node.  Why not roll your own?  That's my plan...\n","readmeFilename":"README.md","_id":"kally-razor@0.0.3","dist":{"shasum":"cd07ce3de1969e3423dfd657cc397bca45cb14e7","tarball":"https://registry.npmjs.org/kally-razor/-/kally-razor-0.0.3.tgz","integrity":"sha512-QpbO3mCW+6bXqkm8DU1Lb9UxZFGcyZ2CUAOtQGe0WaHzcCir1b79TfLpmxcZXJV5/NBmowBcpn7roWFXFbI29g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFF6nuPR8DFGjsio2l4zNGIAFblnJQl2XXFHh5DuC89iAiBH3HoTsNXMGllIMzuLcaYUbS4FkBfrp+L18XBfWFdTpw=="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"nufyoot","email":"nufyoot@gmail.com"},"maintainers":[{"name":"nufyoot","email":"nufyoot@gmail.com"}]},"0.0.5":{"name":"kally-razor","version":"0.0.5","description":"Razor engine for Node","main":"lib/main.js","directories":{"test":"test"},"scripts":{"test":"make test-coveralls"},"repository":{"type":"git","url":"git://github.com/nufyoot/kally-razor.git"},"keywords":["razor","node","kally-razor","kally"],"devDependencies":{"chai":"*","mocha":"*","coveralls":"*","jscoverage":"*","mocha-lcov-reporter":"*"},"dependencies":{"express":"3.x"},"author":{"name":"Terry Tice","email":"nufyoot@gmail.com"},"readme":"kally-razor\n===========\n\n[![Build Status](https://travis-ci.org/nufyoot/kally-razor.png?branch=master)](https://travis-ci.org/nufyoot/kally-razor)\n\n[![Coverage Status](https://coveralls.io/repos/nufyoot/kally-razor/badge.png?branch=master)](https://coveralls.io/r/nufyoot/kally-razor?branch=master)\n\nLooking for an awesome Razor engine for Node.  Why not roll your own?  That's my plan...\n","readmeFilename":"README.md","_id":"kally-razor@0.0.5","dist":{"shasum":"d7780c6af49b7f98037828a5a842f787f3ef48d6","tarball":"https://registry.npmjs.org/kally-razor/-/kally-razor-0.0.5.tgz","integrity":"sha512-LyvctvgHDqAxq+jcdP/fEwQFeqGPKAs2pPv+CKthyxi47BTJ7kqf1OUHxcaVNIre6NozAuUAS3HnkC7/ZNO7Ww==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7V8mJCHC6K6aYxGTmXAWYqBhoZgHtPlVomXtfQi/AOgIgflytvX1wz+LFKIp0O3XDQkF9emaHCalz1r8HbZnF7yY="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"nufyoot","email":"nufyoot@gmail.com"},"maintainers":[{"name":"nufyoot","email":"nufyoot@gmail.com"}]},"0.1.0":{"name":"kally-razor","version":"0.1.0","description":"Razor engine for Node","main":"lib/main.js","directories":{"test":"test"},"scripts":{"test":"make test-coveralls"},"repository":{"type":"git","url":"git://github.com/nufyoot/kally-razor.git"},"keywords":["razor","node","kally-razor","kally"],"devDependencies":{"chai":"*","mocha":"*","coveralls":"*","jscoverage":"*","mocha-lcov-reporter":"*"},"dependencies":{"express":"3.x"},"author":{"name":"Terry Tice","email":"nufyoot@gmail.com"},"readme":"kally-razor\n===========\n\n[![Build Status](https://travis-ci.org/nufyoot/kally-razor.png?branch=master)](https://travis-ci.org/nufyoot/kally-razor) [![Coverage Status](https://coveralls.io/repos/nufyoot/kally-razor/badge.png?branch=master)](https://coveralls.io/r/nufyoot/kally-razor?branch=master)\n\nMoving from C# and MVC in the .NET world, I've grown quite fond of using Razor.  Sure, there are other view engines for Node.js, but none of them quite hit what I needed.\n\n### Installing KallyRazor\nProbably the easiest method is to use npm.\n```\nnpm install kally-razor\n```\n\n### What's available?\nFirst, there's the basic syntax:\n```html\n<div>@model.name</div>\n```\nAll views are passed a variable named `model` which contains anything you pass to it.  More on this later.  There's also support for grouping a statement, in the event that it's a bit more complex.\n```html\n<div>@(model.firstName + ' ' + model.lastName)</div>\n```\nThe above line of code could just be written as\n```html\n<div>@model.firstName @model.lasstName</div>\n```\nbut this is just to show an example of a more complex grouping.  Now, all the examples above will evaluate the expression and immediatley output the result right into place.  But what if you need to do some calculations in the view and don't want to output anything yet?\n```html\n@{\n  var i = 12;\n}\n<div>The value of i is @i</div>\n```\n\nOf course, these are all VERY basic examples.  More complex examples to come later.\n\nNow, I mentioned above that all views have a variable named `model` passed in.  But where does the data come from?  Here's an example of how KallyRazor is called.\n```javascript\nvar KallyRazor = require('kally-razor');\nvar razor = KallyRazor({\n  root: __dirname\n});\n\nvar contents = razor.parse('./views/index.html', { firstName: 'Test', lastName: 'Testerson' });\n```\nThe above example pulls in the kally-razor module (assuming you've installed it using npm), then creates a new instance by calling the KallyRazor function passing in some configuration parameters (I'll provide these below).  Finally, we call `razor.parse` and pass it the file name to parse and the model to be passed in.  This will return back to us the contents of the parsed Razor file.  Simple.  Now for the configuration parameters.\n```\n{\n  root: <directory you want to be the root for all file references>\n}\n```\nThe root is the directory you want to be used as the root for all views.  We'll first try to do an exact lookup in the event that you've decided to pass in an absolute file path.  Otherwise, we'll prepend this root parameter to all file references.\n","readmeFilename":"README.md","_id":"kally-razor@0.1.0","dist":{"shasum":"fbbe70712445e299615f7b2114d9d0c4ca629a7e","tarball":"https://registry.npmjs.org/kally-razor/-/kally-razor-0.1.0.tgz","integrity":"sha512-wjI9+yVE9GIK/3fzZF3DmGw58ha5F2J0tOBgspeVxQXPi7cdTYmwR06DAFy32Z9NpgEDe4BtggEtozElpeGcDw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCaICZf/On6KzXWD8ZEt1KkDdoafxJniqZbqVJAbkcxIAIhAJdCKpFki+HRV06ONoQ4rh/yJPfv7jTOodEthCxpH3Io"}]},"_npmVersion":"1.1.69","_npmUser":{"name":"nufyoot","email":"nufyoot@gmail.com"},"maintainers":[{"name":"nufyoot","email":"nufyoot@gmail.com"}]},"0.2.0":{"name":"kally-razor","version":"0.2.0","description":"Razor engine for Node","main":"lib/main.js","directories":{"test":"test"},"scripts":{"test":"make test-coveralls"},"repository":{"type":"git","url":"git://github.com/nufyoot/kally-razor.git"},"keywords":["razor","node","kally-razor","kally"],"devDependencies":{"chai":"*","mocha":"*","coveralls":"*","jscoverage":"*","mocha-lcov-reporter":"*"},"dependencies":{"express":"3.x"},"author":{"name":"Terry Tice","email":"nufyoot@gmail.com"},"readme":"kally-razor\n===========\n\n[![Build Status](https://travis-ci.org/nufyoot/kally-razor.png?branch=master)](https://travis-ci.org/nufyoot/kally-razor) [![Coverage Status](https://coveralls.io/repos/nufyoot/kally-razor/badge.png?branch=master)](https://coveralls.io/r/nufyoot/kally-razor?branch=master)\n\nMoving from C# and MVC in the .NET world, I've grown quite fond of using Razor.  Sure, there are other view engines for Node.js, but none of them quite hit what I needed.\n\n### Installing KallyRazor\nProbably the easiest method is to use npm.\n```\nnpm install kally-razor\n```\n\n### What's available?\nFirst, there's the basic syntax:\n```html\n<div>@model.name</div>\n```\nAll views are passed a variable named `model` which contains anything you pass to it.  More on this later.  There's also support for grouping a statement, in the event that it's a bit more complex.\n```html\n<div>@(model.firstName + ' ' + model.lastName)</div>\n```\nThe above line of code could just be written as\n```html\n<div>@model.firstName @model.lasstName</div>\n```\nbut this is just to show an example of a more complex grouping.  Now, all the examples above will evaluate the expression and immediatley output the result right into place.  But what if you need to do some calculations in the view and don't want to output anything yet?\n```html\n@{\n  var i = 12;\n}\n<div>The value of i is @i</div>\n```\n\nOf course, these are all VERY basic examples.  More complex examples to come later.\n\nNow, I mentioned above that all views have a variable named `model` passed in.  But where does the data come from?  Here's an example of how KallyRazor is called.\n```javascript\nvar KallyRazor = require('kally-razor');\nvar razor = KallyRazor({\n  root: __dirname\n});\n\nvar contents = razor.parse('./views/index.html', { firstName: 'Test', lastName: 'Testerson' });\n```\nThe above example pulls in the kally-razor module (assuming you've installed it using npm), then creates a new instance by calling the KallyRazor function passing in some configuration parameters (I'll provide these below).  Finally, we call `razor.parse` and pass it the file name to parse and the model to be passed in.  This will return back to us the contents of the parsed Razor file.  Simple.  Now for the configuration parameters.\n```\n{\n  root: <directory you want to be the root for all file references>\n}\n```\nThe root is the directory you want to be used as the root for all views.  We'll first try to do an exact lookup in the event that you've decided to pass in an absolute file path.  Otherwise, we'll prepend this root parameter to all file references.\n","readmeFilename":"README.md","_id":"kally-razor@0.2.0","dist":{"shasum":"67d4b0b21f306be5294e198f8e04572887661561","tarball":"https://registry.npmjs.org/kally-razor/-/kally-razor-0.2.0.tgz","integrity":"sha512-Cozu+6m04DKW14PJtw5PqRF3zDJyTSYIHeLnrn5bf+3Dee1m1pOQ9qULKXqqpm9L88VnVozdONbGCptnL0wK9g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHl7FiYvFCoh9AjRRYLzT7FcDUzAFdz660VdnLFFwRZxAiBnHc1sxRp82qW2WhpbDHcmrb9tYz5US7BnfTWq3S4G5A=="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"nufyoot","email":"nufyoot@gmail.com"},"maintainers":[{"name":"nufyoot","email":"nufyoot@gmail.com"}]},"0.2.1":{"name":"kally-razor","version":"0.2.1","description":"Razor engine for Node","main":"lib/main.js","directories":{"test":"test"},"scripts":{"test":"make test-coveralls"},"repository":{"type":"git","url":"git://github.com/nufyoot/kally-razor.git"},"keywords":["razor","node","kally-razor","kally"],"devDependencies":{"chai":"*","mocha":"*","coveralls":"*","jscoverage":"*","mocha-lcov-reporter":"*"},"author":{"name":"Terry Tice","email":"nufyoot@gmail.com"},"readme":"kally-razor\n===========\n\n[![Build Status](https://travis-ci.org/nufyoot/kally-razor.png?branch=master)](https://travis-ci.org/nufyoot/kally-razor) [![Coverage Status](https://coveralls.io/repos/nufyoot/kally-razor/badge.png?branch=master)](https://coveralls.io/r/nufyoot/kally-razor?branch=master)\n\nMoving from C# and MVC in the .NET world, I've grown quite fond of using Razor.  Sure, there are other view engines for Node.js, but none of them quite hit what I needed.\n\n### Installing KallyRazor\nProbably the easiest method is to use npm.\n```\nnpm install kally-razor\n```\n\n### What's available?\nFirst, there's the basic syntax:\n```html\n<div>@model.name</div>\n```\nAll views are passed a variable named `model` which contains anything you pass to it.  More on this later.  There's also support for grouping a statement, in the event that it's a bit more complex.\n```html\n<div>@(model.firstName + ' ' + model.lastName)</div>\n```\nThe above line of code could just be written as\n```html\n<div>@model.firstName @model.lasstName</div>\n```\nbut this is just to show an example of a more complex grouping.  Now, all the examples above will evaluate the expression and immediatley output the result right into place.  But what if you need to do some calculations in the view and don't want to output anything yet?\n```html\n@{\n  var i = 12;\n}\n<div>The value of i is @i</div>\n```\n\nOf course, these are all VERY basic examples.  More complex examples to come later.\n\nNow, I mentioned above that all views have a variable named `model` passed in.  But where does the data come from?  Here's an example of how KallyRazor is called.\n```javascript\nvar KallyRazor = require('kally-razor');\nvar razor = KallyRazor({\n  root: __dirname\n});\n\nvar contents = razor.parse('./views/index.html', { firstName: 'Test', lastName: 'Testerson' });\n```\nThe above example pulls in the kally-razor module (assuming you've installed it using npm), then creates a new instance by calling the KallyRazor function passing in some configuration parameters (I'll provide these below).  Finally, we call `razor.parse` and pass it the file name to parse and the model to be passed in.  This will return back to us the contents of the parsed Razor file.  Simple.  Now for the configuration parameters.\n```\n{\n  root: <directory you want to be the root for all file references>\n}\n```\nThe root is the directory you want to be used as the root for all views.  We'll first try to do an exact lookup in the event that you've decided to pass in an absolute file path.  Otherwise, we'll prepend this root parameter to all file references.\n\n### Layouts\nOne of the cooles things about Razor is the ability to easily to layouts (templates).  Here's a sample call from Node.js\n```javascript\nvar KallyRazor = require('kally-razor');\nvar razor = KallyRazor({\n  root: __dirname + '/views/',\n  layout: 'shared/_layout.html'\n})\n```\nThe above code says that the root of the razor engine should be the views sub folder of the currently executing js file.  Next we specify the default layout (template) to be used.  Let's say we have a very basic layout file so that \"shared/_layout.html\" looks like\n```html\n@{ layout = null; }\n<html>\n  <head>\n    <title>Sample</title>\n  </head>\n  <body>\n    <h1>Some Header</h1>\n    @renderBody()\n  </body>\n</html>\n```\nThe only strange part might be `@renderBody()` which just tells Razor where to place the body content.  Then, having the following line in Node.js\n```javascript\nrazor.render('home/index.html');\n```\nAnd a file \"home/index.html\" that looks like\n```html\n<div>Yeah, it worked!</div>\n```\nthis would all yield:\n```html\n<html>\n  <head>\n    <title>Samples</title>\n  </head>\n  <body>\n    <h1>Some Header</h1>\n    <div>Yeah, it worked!</div>\n  </body>\n</html>\n```\nThat's awesome :)\n","readmeFilename":"README.md","_id":"kally-razor@0.2.1","dist":{"shasum":"6b99e1cf60e29d69a2ffe6006395259c9bf002c9","tarball":"https://registry.npmjs.org/kally-razor/-/kally-razor-0.2.1.tgz","integrity":"sha512-RSCBW6D6yCvBWWY+rQHu9rgEV/tPR2vY9GKn0Zu0E5oQMkn/e3WDBfnPw5Y6W9pd3Dt4YTOm7HTPd7mR9UXg+g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhw/Yj/5WFdQCTjUB6YaKomAqYSeRA5gMd5veQs/MV1wIgZ9EE/STH+az5C2Ml0tvFLlUWia8P43eARMxRebBIfeE="}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"nufyoot","email":"nufyoot@gmail.com"},"maintainers":[{"name":"nufyoot","email":"nufyoot@gmail.com"}]},"0.3.0":{"name":"kally-razor","version":"0.3.0","description":"Razor engine for Node","main":"lib/main.js","directories":{"test":"test"},"scripts":{"test":"make test-coveralls"},"repository":{"type":"git","url":"git://github.com/nufyoot/kally-razor.git"},"keywords":["razor","node","kally-razor","kally"],"devDependencies":{"chai":"*","mocha":"*","coveralls":"*","jscoverage":"*","mocha-lcov-reporter":"*"},"author":{"name":"Terry Tice","email":"nufyoot@gmail.com"},"readme":"kally-razor\n===========\n\n[![Build Status](https://travis-ci.org/nufyoot/kally-razor.png?branch=master)](https://travis-ci.org/nufyoot/kally-razor) [![Coverage Status](https://coveralls.io/repos/nufyoot/kally-razor/badge.png?branch=master)](https://coveralls.io/r/nufyoot/kally-razor?branch=master)\n\nMoving from C# and MVC in the .NET world, I've grown quite fond of using Razor.  Sure, there are other view engines for Node.js, but none of them quite hit what I needed.\n\n### Installing KallyRazor\nProbably the easiest method is to use npm.\n```\nnpm install kally-razor\n```\n\n### Testing KallyRazor\nOSX\n```\nmake test\n```\n\nWindows\n```\n./test.bat\n```\n\n### What's available?\nFirst, there's the basic syntax:\n```html\n<div>@model.name</div>\n```\nAll views are passed a variable named `model` which contains anything you pass to it.  More on this later.  There's also support for grouping a statement, in the event that it's a bit more complex.\n```html\n<div>@(model.firstName + ' ' + model.lastName)</div>\n```\nThe above line of code could just be written as\n```html\n<div>@model.firstName @model.lasstName</div>\n```\nbut this is just to show an example of a more complex grouping.  Now, all the examples above will evaluate the expression and immediatley output the result right into place.  But what if you need to do some calculations in the view and don't want to output anything yet?\n```html\n@{\n  var i = 12;\n}\n<div>The value of i is @i</div>\n```\n\nOf course, these are all VERY basic examples.  More complex examples to come later.\n\nNow, I mentioned above that all views have a variable named `model` passed in.  But where does the data come from?  Here's an example of how KallyRazor is called.\n```javascript\nvar KallyRazor = require('kally-razor');\nvar razor = KallyRazor({\n  root: __dirname\n});\n\nvar contents = razor.parse('./views/index.html', { firstName: 'Test', lastName: 'Testerson' });\n```\nThe above example pulls in the kally-razor module (assuming you've installed it using npm), then creates a new instance by calling the KallyRazor function passing in some configuration parameters (I'll provide these below).  Finally, we call `razor.parse` and pass it the file name to parse and the model to be passed in.  This will return back to us the contents of the parsed Razor file.  Simple.  Now for the configuration parameters.\n```\n{\n  root: <directory you want to be the root for all file references>\n}\n```\nThe root is the directory you want to be used as the root for all views.  We'll first try to do an exact lookup in the event that you've decided to pass in an absolute file path.  Otherwise, we'll prepend this root parameter to all file references.\n\n### Layouts\nOne of the cooles things about Razor is the ability to easily to layouts (templates).  Here's a sample call from Node.js\n```javascript\nvar KallyRazor = require('kally-razor');\nvar razor = KallyRazor({\n  root: __dirname + '/views/',\n  layout: 'shared/_layout.html'\n})\n```\nThe above code says that the root of the razor engine should be the views sub folder of the currently executing js file.  Next we specify the default layout (template) to be used.  Let's say we have a very basic layout file so that \"shared/_layout.html\" looks like\n```html\n@{ layout = null; }\n<html>\n  <head>\n    <title>Sample</title>\n  </head>\n  <body>\n    <h1>Some Header</h1>\n    @renderBody()\n  </body>\n</html>\n```\nThe only strange part might be `@renderBody()` which just tells Razor where to place the body content.  Then, having the following line in Node.js\n```javascript\nrazor.render('home/index.html');\n```\nAnd a file \"home/index.html\" that looks like\n```html\n<div>Yeah, it worked!</div>\n```\nthis would all yield:\n```html\n<html>\n  <head>\n    <title>Samples</title>\n  </head>\n  <body>\n    <h1>Some Header</h1>\n    <div>Yeah, it worked!</div>\n  </body>\n</html>\n```\nThat's awesome :)\n","readmeFilename":"README.md","_id":"kally-razor@0.3.0","dist":{"shasum":"a545eb1bd32d0c2f5364fde0892442fa820f91bd","tarball":"https://registry.npmjs.org/kally-razor/-/kally-razor-0.3.0.tgz","integrity":"sha512-aXIqJ0pWajkG7ZJQZFTRlN4BXEqIE0lS3J5MLGmWLKuUtFSUP0Le7IgJzC8Zj4BXdrEN5zjkmqCVDHwU3gi4aQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/WhPTKwlhZnKFSQWqiBZfhgwo/oSvPji9xdIAM34tXwIhAMVXViJ0C1QmEqlq2NdQ7lH1cJ1nlSfrd62aLW3aSkEp"}]},"_npmVersion":"1.1.69","_npmUser":{"name":"nufyoot","email":"nufyoot@gmail.com"},"maintainers":[{"name":"nufyoot","email":"nufyoot@gmail.com"}]},"0.3.1":{"name":"kally-razor","version":"0.3.1","description":"Razor engine for Node","main":"lib/main.js","directories":{"test":"test"},"scripts":{"test":"make test-coveralls"},"repository":{"type":"git","url":"git://github.com/nufyoot/kally-razor.git"},"keywords":["razor","node","kally-razor","kally"],"devDependencies":{"chai":"*","mocha":"*","coveralls":"*","jscoverage":"*","mocha-lcov-reporter":"*"},"author":{"name":"Terry Tice","email":"nufyoot@gmail.com"},"readme":"kally-razor\n===========\n\n[![Build Status](https://travis-ci.org/nufyoot/kally-razor.png?branch=master)](https://travis-ci.org/nufyoot/kally-razor) [![Coverage Status](https://coveralls.io/repos/nufyoot/kally-razor/badge.png?branch=master)](https://coveralls.io/r/nufyoot/kally-razor?branch=master)\n\nMoving from C# and MVC in the .NET world, I've grown quite fond of using Razor.  Sure, there are other view engines for Node.js, but none of them quite hit what I needed.\n\n### Installing KallyRazor\nProbably the easiest method is to use npm.\n```\nnpm install kally-razor\n```\n\n### Testing KallyRazor\nOSX\n```\nmake test\n```\n\nWindows\n```\n./test.bat\n```\n\n### What's available?\nFirst, there's the basic syntax:\n```html\n<div>@model.name</div>\n```\nAll views are passed a variable named `model` which contains anything you pass to it.  More on this later.  There's also support for grouping a statement, in the event that it's a bit more complex.\n```html\n<div>@(model.firstName + ' ' + model.lastName)</div>\n```\nThe above line of code could just be written as\n```html\n<div>@model.firstName @model.lasstName</div>\n```\nbut this is just to show an example of a more complex grouping.  Now, all the examples above will evaluate the expression and immediatley output the result right into place.  But what if you need to do some calculations in the view and don't want to output anything yet?\n```html\n@{\n  var i = 12;\n}\n<div>The value of i is @i</div>\n```\n\nOf course, these are all VERY basic examples.  More complex examples to come later.\n\nNow, I mentioned above that all views have a variable named `model` passed in.  But where does the data come from?  Here's an example of how KallyRazor is called.\n```javascript\nvar KallyRazor = require('kally-razor');\nvar razor = KallyRazor({\n  root: __dirname\n});\n\nvar contents = razor.parse('./views/index.html', { firstName: 'Test', lastName: 'Testerson' });\n```\nThe above example pulls in the kally-razor module (assuming you've installed it using npm), then creates a new instance by calling the KallyRazor function passing in some configuration parameters (I'll provide these below).  Finally, we call `razor.parse` and pass it the file name to parse and the model to be passed in.  This will return back to us the contents of the parsed Razor file.  Simple.  Now for the configuration parameters.\n```\n{\n  root: <directory you want to be the root for all file references>\n}\n```\nThe root is the directory you want to be used as the root for all views.  We'll first try to do an exact lookup in the event that you've decided to pass in an absolute file path.  Otherwise, we'll prepend this root parameter to all file references.\n\n### Layouts\nOne of the cooles things about Razor is the ability to easily to layouts (templates).  Here's a sample call from Node.js\n```javascript\nvar KallyRazor = require('kally-razor');\nvar razor = KallyRazor({\n  root: __dirname + '/views/',\n  layout: 'shared/_layout.html'\n})\n```\nThe above code says that the root of the razor engine should be the views sub folder of the currently executing js file.  Next we specify the default layout (template) to be used.  Let's say we have a very basic layout file so that \"shared/_layout.html\" looks like\n```html\n@{ layout = null; }\n<html>\n  <head>\n    <title>Sample</title>\n  </head>\n  <body>\n    <h1>Some Header</h1>\n    @renderBody()\n  </body>\n</html>\n```\nThe only strange part might be `@renderBody()` which just tells Razor where to place the body content.  Then, having the following line in Node.js\n```javascript\nrazor.render('home/index.html');\n```\nAnd a file \"home/index.html\" that looks like\n```html\n<div>Yeah, it worked!</div>\n```\nthis would all yield:\n```html\n<html>\n  <head>\n    <title>Samples</title>\n  </head>\n  <body>\n    <h1>Some Header</h1>\n    <div>Yeah, it worked!</div>\n  </body>\n</html>\n```\nThat's awesome :)\n","readmeFilename":"README.md","_id":"kally-razor@0.3.1","dist":{"shasum":"5e06a0eecdbaa87c31239f1453e144721d782f8d","tarball":"https://registry.npmjs.org/kally-razor/-/kally-razor-0.3.1.tgz","integrity":"sha512-cRNbrUigR6iSaRl4L3wnJ701ldcxFNNkWXENO7kIN83TJ+BYz5D9NbrbW0+/9EFgRkuLuD7UZ8+3Erd437RtHA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQChJpvBvrk8TsQw2t3olUuRQWDvjmdXdKPHZvwe2vqivAIhAMq2nZJezos77bF8Wc3y6GocDq2IaMCtlo8qpfAju5BK"}]},"_npmVersion":"1.1.69","_npmUser":{"name":"nufyoot","email":"nufyoot@gmail.com"},"maintainers":[{"name":"nufyoot","email":"nufyoot@gmail.com"}]},"0.3.2":{"name":"kally-razor","version":"0.3.2","description":"Razor engine for Node","main":"lib/main.js","directories":{"test":"test"},"scripts":{"test":"make test-coveralls"},"repository":{"type":"git","url":"git://github.com/nufyoot/kally-razor.git"},"keywords":["razor","node","kally-razor","kally"],"devDependencies":{"chai":"*","mocha":"*","coveralls":"*","jscoverage":"*","mocha-lcov-reporter":"*"},"author":{"name":"Terry Tice","email":"nufyoot@gmail.com"},"readme":"kally-razor\n===========\n\n[![Build Status](https://travis-ci.org/nufyoot/kally-razor.png?branch=master)](https://travis-ci.org/nufyoot/kally-razor) [![Coverage Status](https://coveralls.io/repos/nufyoot/kally-razor/badge.png?branch=master)](https://coveralls.io/r/nufyoot/kally-razor?branch=master)\n\nMoving from C# and MVC in the .NET world, I've grown quite fond of using Razor.  Sure, there are other view engines for Node.js, but none of them quite hit what I needed.\n\n### Installing KallyRazor\nProbably the easiest method is to use npm.\n```\nnpm install kally-razor\n```\n\n### Testing KallyRazor\nOSX\n```\nmake test\n```\n\nWindows\n```\n./test.bat\n```\n\n### What's available?\nFirst, there's the basic syntax:\n```html\n<div>@model.name</div>\n```\nAll views are passed a variable named `model` which contains anything you pass to it.  More on this later.  There's also support for grouping a statement, in the event that it's a bit more complex.\n```html\n<div>@(model.firstName + ' ' + model.lastName)</div>\n```\nThe above line of code could just be written as\n```html\n<div>@model.firstName @model.lasstName</div>\n```\nbut this is just to show an example of a more complex grouping.  Now, all the examples above will evaluate the expression and immediatley output the result right into place.  But what if you need to do some calculations in the view and don't want to output anything yet?\n```html\n@{\n  var i = 12;\n}\n<div>The value of i is @i</div>\n```\n\nOf course, these are all VERY basic examples.  More complex examples to come later.\n\nNow, I mentioned above that all views have a variable named `model` passed in.  But where does the data come from?  Here's an example of how KallyRazor is called.\n```javascript\nvar KallyRazor = require('kally-razor');\nvar razor = KallyRazor({\n  root: __dirname\n});\n\nvar contents = razor.parse('./views/index.html', { firstName: 'Test', lastName: 'Testerson' });\n```\nThe above example pulls in the kally-razor module (assuming you've installed it using npm), then creates a new instance by calling the KallyRazor function passing in some configuration parameters (I'll provide these below).  Finally, we call `razor.parse` and pass it the file name to parse and the model to be passed in.  This will return back to us the contents of the parsed Razor file.  Simple.  Now for the configuration parameters.\n```\n{\n  root: <directory you want to be the root for all file references>\n}\n```\nThe root is the directory you want to be used as the root for all views.  We'll first try to do an exact lookup in the event that you've decided to pass in an absolute file path.  Otherwise, we'll prepend this root parameter to all file references.\n\n### Layouts\nOne of the cooles things about Razor is the ability to easily to layouts (templates).  Here's a sample call from Node.js\n```javascript\nvar KallyRazor = require('kally-razor');\nvar razor = KallyRazor({\n  root: __dirname + '/views/',\n  layout: 'shared/_layout.html'\n})\n```\nThe above code says that the root of the razor engine should be the views sub folder of the currently executing js file.  Next we specify the default layout (template) to be used.  Let's say we have a very basic layout file so that \"shared/_layout.html\" looks like\n```html\n@{ layout = null; }\n<html>\n  <head>\n    <title>Sample</title>\n  </head>\n  <body>\n    <h1>Some Header</h1>\n    @renderBody()\n  </body>\n</html>\n```\nThe only strange part might be `@renderBody()` which just tells Razor where to place the body content.  Then, having the following line in Node.js\n```javascript\nrazor.render('home/index.html');\n```\nAnd a file \"home/index.html\" that looks like\n```html\n<div>Yeah, it worked!</div>\n```\nthis would all yield:\n```html\n<html>\n  <head>\n    <title>Samples</title>\n  </head>\n  <body>\n    <h1>Some Header</h1>\n    <div>Yeah, it worked!</div>\n  </body>\n</html>\n```\nThat's awesome :)\n","readmeFilename":"README.md","_id":"kally-razor@0.3.2","dist":{"shasum":"bd41d8f4d97994feef0f62a4421346285927d848","tarball":"https://registry.npmjs.org/kally-razor/-/kally-razor-0.3.2.tgz","integrity":"sha512-E+z709mgnWViDqVzp26xy/TQEFa9+Z4V+0SPhQ7QV7BGZoWin/1OVjYfNO1Td0WnW7+iStGYW/Z3HaQAgbAYog==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC66G1uKg45ciKX0n+BjvKrMoej5f1pNVDQ1UIHJKFyMwIgBFnZEom1pMvnszBoKaxA8B8ksX/mFYZzPkI1I7UCMKI="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"nufyoot","email":"nufyoot@gmail.com"},"maintainers":[{"name":"nufyoot","email":"nufyoot@gmail.com"}]},"0.3.3":{"name":"kally-razor","version":"0.3.3","description":"Razor engine for Node","main":"lib/main.js","directories":{"test":"test"},"scripts":{"test":"make test-coveralls"},"repository":{"type":"git","url":"git://github.com/nufyoot/kally-razor.git"},"keywords":["razor","node","kally-razor","kally"],"devDependencies":{"chai":"*","mocha":"*","coveralls":"*","jscoverage":"*","mocha-lcov-reporter":"*"},"author":{"name":"Terry Tice","email":"nufyoot@gmail.com"},"readme":"kally-razor\n===========\n\n[![Build Status](https://travis-ci.org/nufyoot/kally-razor.png?branch=master)](https://travis-ci.org/nufyoot/kally-razor) [![Coverage Status](https://coveralls.io/repos/nufyoot/kally-razor/badge.png?branch=master)](https://coveralls.io/r/nufyoot/kally-razor?branch=master)\n\nMoving from C# and MVC in the .NET world, I've grown quite fond of using Razor.  Sure, there are other view engines for Node.js, but none of them quite hit what I needed.\n\n### Installing KallyRazor\nProbably the easiest method is to use npm.\n```\nnpm install kally-razor\n```\n\n### Testing KallyRazor\nOSX\n```\nmake test\n```\n\nWindows\n```\n./test.bat\n```\n\n### What's available?\nFirst, there's the basic syntax:\n```html\n<div>@model.name</div>\n```\nAll views are passed a variable named `model` which contains anything you pass to it.  More on this later.  There's also support for grouping a statement, in the event that it's a bit more complex.\n```html\n<div>@(model.firstName + ' ' + model.lastName)</div>\n```\nThe above line of code could just be written as\n```html\n<div>@model.firstName @model.lasstName</div>\n```\nbut this is just to show an example of a more complex grouping.  Now, all the examples above will evaluate the expression and immediatley output the result right into place.  But what if you need to do some calculations in the view and don't want to output anything yet?\n```html\n@{\n  var i = 12;\n}\n<div>The value of i is @i</div>\n```\n\nOf course, these are all VERY basic examples.  More complex examples to come later.\n\nNow, I mentioned above that all views have a variable named `model` passed in.  But where does the data come from?  Here's an example of how KallyRazor is called.\n```javascript\nvar KallyRazor = require('kally-razor');\nvar razor = KallyRazor({\n  root: __dirname\n});\n\nvar contents = razor.parse('./views/index.html', { firstName: 'Test', lastName: 'Testerson' });\n```\nThe above example pulls in the kally-razor module (assuming you've installed it using npm), then creates a new instance by calling the KallyRazor function passing in some configuration parameters (I'll provide these below).  Finally, we call `razor.parse` and pass it the file name to parse and the model to be passed in.  This will return back to us the contents of the parsed Razor file.  Simple.  Now for the configuration parameters.\n```\n{\n  root: <directory you want to be the root for all file references>\n}\n```\nThe root is the directory you want to be used as the root for all views.  We'll first try to do an exact lookup in the event that you've decided to pass in an absolute file path.  Otherwise, we'll prepend this root parameter to all file references.\n\n### Layouts\nOne of the cooles things about Razor is the ability to easily to layouts (templates).  Here's a sample call from Node.js\n```javascript\nvar KallyRazor = require('kally-razor');\nvar razor = KallyRazor({\n  root: __dirname + '/views/',\n  layout: 'shared/_layout.html'\n})\n```\nThe above code says that the root of the razor engine should be the views sub folder of the currently executing js file.  Next we specify the default layout (template) to be used.  Let's say we have a very basic layout file so that \"shared/_layout.html\" looks like\n```html\n@{ layout = null; }\n<html>\n  <head>\n    <title>Sample</title>\n  </head>\n  <body>\n    <h1>Some Header</h1>\n    @renderBody()\n  </body>\n</html>\n```\nThe only strange part might be `@renderBody()` which just tells Razor where to place the body content.  Then, having the following line in Node.js\n```javascript\nrazor.render('home/index.html');\n```\nAnd a file \"home/index.html\" that looks like\n```html\n<div>Yeah, it worked!</div>\n```\nthis would all yield:\n```html\n<html>\n  <head>\n    <title>Samples</title>\n  </head>\n  <body>\n    <h1>Some Header</h1>\n    <div>Yeah, it worked!</div>\n  </body>\n</html>\n```\nThat's awesome :)\n","readmeFilename":"README.md","_id":"kally-razor@0.3.3","dist":{"shasum":"b73914a7dbe304a5df1b84f4104edb40d57014bd","tarball":"https://registry.npmjs.org/kally-razor/-/kally-razor-0.3.3.tgz","integrity":"sha512-4M/Qp8+hfQLP0q7GOzEyCZL+yueGMz56uicIMXjqBAetJUiW6aAxl+JMMbhfgdt7kAfJ38y4OsPMDGwa3odwsw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFkSZRS5GgihzkBqpkXWrT8T9VHTt7ZwiZOurkhiGUf4AiAPw20VPBi3OTktbt9yKC/m0HKG/Wzm4IQvrdTAlSAepw=="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"nufyoot","email":"nufyoot@gmail.com"},"maintainers":[{"name":"nufyoot","email":"nufyoot@gmail.com"}]},"0.3.4":{"name":"kally-razor","version":"0.3.4","description":"Razor engine for Node","main":"lib/main.js","directories":{"test":"test"},"scripts":{"test":"make test-coveralls"},"repository":{"type":"git","url":"git://github.com/nufyoot/kally-razor.git"},"keywords":["razor","node","kally-razor","kally"],"devDependencies":{"chai":"*","mocha":"*","coveralls":"*","jscoverage":"*","mocha-lcov-reporter":"*"},"author":{"name":"Terry Tice","email":"nufyoot@gmail.com"},"readme":"kally-razor\n===========\n\n[![Build Status](https://travis-ci.org/nufyoot/kally-razor.png?branch=master)](https://travis-ci.org/nufyoot/kally-razor) [![Coverage Status](https://coveralls.io/repos/nufyoot/kally-razor/badge.png?branch=master)](https://coveralls.io/r/nufyoot/kally-razor?branch=master)\n\nMoving from C# and MVC in the .NET world, I've grown quite fond of using Razor.  Sure, there are other view engines for Node.js, but none of them quite hit what I needed.\n\n### Installing KallyRazor\nProbably the easiest method is to use npm.\n```\nnpm install kally-razor\n```\n\n### Testing KallyRazor\nOSX\n```\nmake test\n```\n\nWindows\n```\n./test.bat\n```\n\n### What's available?\nFirst, there's the basic syntax:\n```html\n<div>@model.name</div>\n```\nAll views are passed a variable named `model` which contains anything you pass to it.  More on this later.  There's also support for grouping a statement, in the event that it's a bit more complex.\n```html\n<div>@(model.firstName + ' ' + model.lastName)</div>\n```\nThe above line of code could just be written as\n```html\n<div>@model.firstName @model.lasstName</div>\n```\nbut this is just to show an example of a more complex grouping.  Now, all the examples above will evaluate the expression and immediatley output the result right into place.  But what if you need to do some calculations in the view and don't want to output anything yet?\n```html\n@{\n  var i = 12;\n}\n<div>The value of i is @i</div>\n```\n\nOf course, these are all VERY basic examples.  More complex examples to come later.\n\nNow, I mentioned above that all views have a variable named `model` passed in.  But where does the data come from?  Here's an example of how KallyRazor is called.\n```javascript\nvar KallyRazor = require('kally-razor');\nvar razor = KallyRazor({\n  root: __dirname\n});\n\nvar contents = razor.parse('./views/index.html', { firstName: 'Test', lastName: 'Testerson' });\n```\nThe above example pulls in the kally-razor module (assuming you've installed it using npm), then creates a new instance by calling the KallyRazor function passing in some configuration parameters (I'll provide these below).  Finally, we call `razor.parse` and pass it the file name to parse and the model to be passed in.  This will return back to us the contents of the parsed Razor file.  Simple.  Now for the configuration parameters.\n```\n{\n  root: <directory you want to be the root for all file references>\n}\n```\nThe root is the directory you want to be used as the root for all views.  We'll first try to do an exact lookup in the event that you've decided to pass in an absolute file path.  Otherwise, we'll prepend this root parameter to all file references.\n\n### Layouts\nOne of the cooles things about Razor is the ability to easily to layouts (templates).  Here's a sample call from Node.js\n```javascript\nvar KallyRazor = require('kally-razor');\nvar razor = KallyRazor({\n  root: __dirname + '/views/',\n  layout: 'shared/_layout.html'\n})\n```\nThe above code says that the root of the razor engine should be the views sub folder of the currently executing js file.  Next we specify the default layout (template) to be used.  Let's say we have a very basic layout file so that \"shared/_layout.html\" looks like\n```html\n@{ layout = null; }\n<html>\n  <head>\n    <title>Sample</title>\n  </head>\n  <body>\n    <h1>Some Header</h1>\n    @renderBody()\n  </body>\n</html>\n```\nThe only strange part might be `@renderBody()` which just tells Razor where to place the body content.  Then, having the following line in Node.js\n```javascript\nrazor.render('home/index.html');\n```\nAnd a file \"home/index.html\" that looks like\n```html\n<div>Yeah, it worked!</div>\n```\nthis would all yield:\n```html\n<html>\n  <head>\n    <title>Samples</title>\n  </head>\n  <body>\n    <h1>Some Header</h1>\n    <div>Yeah, it worked!</div>\n  </body>\n</html>\n```\nThat's awesome :)\n","readmeFilename":"README.md","_id":"kally-razor@0.3.4","dist":{"shasum":"a3cdfd564847ab01628d0d40af41929455be7514","tarball":"https://registry.npmjs.org/kally-razor/-/kally-razor-0.3.4.tgz","integrity":"sha512-QOOHmblGoWvl2LfOIwYgbqZauN8fDuX12v8K/BK8gJknwYBg+ApdetjkKsJPDkfoJgiFIgsk5nl+Acfs+VwhxA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGO1aLdvXK7ig+intO5Cu0bEhwmXGyPvGjyFCG9gNy46AiEA1/a0zN1ZkRmXskU9l3QavUxCHv0ttCgeAUMyFx3fHgQ="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"nufyoot","email":"nufyoot@gmail.com"},"maintainers":[{"name":"nufyoot","email":"nufyoot@gmail.com"}]},"0.3.5":{"name":"kally-razor","version":"0.3.5","description":"Razor engine for Node","main":"lib/main.js","directories":{"test":"test"},"scripts":{"test":"make test-coveralls"},"repository":{"type":"git","url":"git://github.com/nufyoot/kally-razor.git"},"keywords":["razor","node","kally-razor","kally"],"devDependencies":{"chai":"*","mocha":"*","coveralls":"*","jscoverage":"*","mocha-lcov-reporter":"*"},"author":{"name":"Terry Tice","email":"nufyoot@gmail.com"},"readme":"kally-razor\n===========\n\n[![Build Status](https://travis-ci.org/nufyoot/kally-razor.png?branch=master)](https://travis-ci.org/nufyoot/kally-razor) [![Coverage Status](https://coveralls.io/repos/nufyoot/kally-razor/badge.png?branch=master)](https://coveralls.io/r/nufyoot/kally-razor?branch=master)\n\nMoving from C# and MVC in the .NET world, I've grown quite fond of using Razor.  Sure, there are other view engines for Node.js, but none of them quite hit what I needed.\n\n### Installing KallyRazor\nProbably the easiest method is to use npm.\n```\nnpm install kally-razor\n```\n\n### Testing KallyRazor\nOSX\n```\nmake test\n```\n\nWindows\n```\n./test.bat\n```\n\n### What's available?\nFirst, there's the basic syntax:\n```html\n<div>@model.name</div>\n```\nAll views are passed a variable named `model` which contains anything you pass to it.  More on this later.  There's also support for grouping a statement, in the event that it's a bit more complex.\n```html\n<div>@(model.firstName + ' ' + model.lastName)</div>\n```\nThe above line of code could just be written as\n```html\n<div>@model.firstName @model.lasstName</div>\n```\nbut this is just to show an example of a more complex grouping.  Now, all the examples above will evaluate the expression and immediatley output the result right into place.  But what if you need to do some calculations in the view and don't want to output anything yet?\n```html\n@{\n  var i = 12;\n}\n<div>The value of i is @i</div>\n```\n\nOf course, these are all VERY basic examples.  More complex examples to come later.\n\nNow, I mentioned above that all views have a variable named `model` passed in.  But where does the data come from?  Here's an example of how KallyRazor is called.\n```javascript\nvar KallyRazor = require('kally-razor');\nvar razor = KallyRazor({\n  root: __dirname\n});\n\nvar contents = razor.parse('./views/index.html', { firstName: 'Test', lastName: 'Testerson' });\n```\nThe above example pulls in the kally-razor module (assuming you've installed it using npm), then creates a new instance by calling the KallyRazor function passing in some configuration parameters (I'll provide these below).  Finally, we call `razor.parse` and pass it the file name to parse and the model to be passed in.  This will return back to us the contents of the parsed Razor file.  Simple.  Now for the configuration parameters.\n```\n{\n  root: <directory you want to be the root for all file references>\n}\n```\nThe root is the directory you want to be used as the root for all views.  We'll first try to do an exact lookup in the event that you've decided to pass in an absolute file path.  Otherwise, we'll prepend this root parameter to all file references.\n\n### Layouts\nOne of the cooles things about Razor is the ability to easily to layouts (templates).  Here's a sample call from Node.js\n```javascript\nvar KallyRazor = require('kally-razor');\nvar razor = KallyRazor({\n  root: __dirname + '/views/',\n  layout: 'shared/_layout.html'\n})\n```\nThe above code says that the root of the razor engine should be the views sub folder of the currently executing js file.  Next we specify the default layout (template) to be used.  Let's say we have a very basic layout file so that \"shared/_layout.html\" looks like\n```html\n@{ layout = null; }\n<html>\n  <head>\n    <title>Sample</title>\n  </head>\n  <body>\n    <h1>Some Header</h1>\n    @renderBody()\n  </body>\n</html>\n```\nThe only strange part might be `@renderBody()` which just tells Razor where to place the body content.  Then, having the following line in Node.js\n```javascript\nrazor.render('home/index.html');\n```\nAnd a file \"home/index.html\" that looks like\n```html\n<div>Yeah, it worked!</div>\n```\nthis would all yield:\n```html\n<html>\n  <head>\n    <title>Samples</title>\n  </head>\n  <body>\n    <h1>Some Header</h1>\n    <div>Yeah, it worked!</div>\n  </body>\n</html>\n```\nThat's awesome :)\n","readmeFilename":"README.md","_id":"kally-razor@0.3.5","dist":{"shasum":"6e78543cd2e54a093c303dd15f4cebd2aa282d1e","tarball":"https://registry.npmjs.org/kally-razor/-/kally-razor-0.3.5.tgz","integrity":"sha512-gmeGnweCSBc4Nw/RP2FEyJa0Mz5Mbx+Bb+6sCr0qUxZx0a6LZI9D4yC/n6crtcThjyzAX76N0tkPfg7HQkFeCQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlDxm+FyEG6DrSNHGajnwtpZ3nLp3rvQ7v+pwKHSR+CwIhAPJb5Ef2Y3bmoNwcLbFelOwwwjRNJb5iR+apl1WQWa2s"}]},"_npmVersion":"1.1.69","_npmUser":{"name":"nufyoot","email":"nufyoot@gmail.com"},"maintainers":[{"name":"nufyoot","email":"nufyoot@gmail.com"}]},"0.3.6":{"name":"kally-razor","version":"0.3.6","description":"Razor engine for Node","main":"lib/main.js","directories":{"test":"test"},"scripts":{"test":"make test-coveralls"},"repository":{"type":"git","url":"git://github.com/nufyoot/kally-razor.git"},"keywords":["razor","node","kally-razor","kally"],"devDependencies":{"chai":"*","mocha":"*","coveralls":"*","jscoverage":"*","mocha-lcov-reporter":"*"},"author":{"name":"Terry Tice","email":"nufyoot@gmail.com"},"readme":"kally-razor\n===========\n\n[![Build Status](https://travis-ci.org/nufyoot/kally-razor.png?branch=master)](https://travis-ci.org/nufyoot/kally-razor) [![Coverage Status](https://coveralls.io/repos/nufyoot/kally-razor/badge.png?branch=master)](https://coveralls.io/r/nufyoot/kally-razor?branch=master)\n\nMoving from C# and MVC in the .NET world, I've grown quite fond of using Razor.  Sure, there are other view engines for Node.js, but none of them quite hit what I needed.\n\n### Installing KallyRazor\nProbably the easiest method is to use npm.\n```\nnpm install kally-razor\n```\n\n### Testing KallyRazor\nOSX\n```\nmake test\n```\n\nWindows\n```\n./test.bat\n```\n\n### What's available?\nFirst, there's the basic syntax:\n```html\n<div>@model.name</div>\n```\nAll views are passed a variable named `model` which contains anything you pass to it.  More on this later.  There's also support for grouping a statement, in the event that it's a bit more complex.\n```html\n<div>@(model.firstName + ' ' + model.lastName)</div>\n```\nThe above line of code could just be written as\n```html\n<div>@model.firstName @model.lasstName</div>\n```\nbut this is just to show an example of a more complex grouping.  Now, all the examples above will evaluate the expression and immediatley output the result right into place.  But what if you need to do some calculations in the view and don't want to output anything yet?\n```html\n@{\n  var i = 12;\n}\n<div>The value of i is @i</div>\n```\n\nOf course, these are all VERY basic examples.  More complex examples to come later.\n\nNow, I mentioned above that all views have a variable named `model` passed in.  But where does the data come from?  Here's an example of how KallyRazor is called.\n```javascript\nvar KallyRazor = require('kally-razor');\nvar razor = KallyRazor({\n  root: __dirname\n});\n\nvar contents = razor.parse('./views/index.html', { firstName: 'Test', lastName: 'Testerson' });\n```\nThe above example pulls in the kally-razor module (assuming you've installed it using npm), then creates a new instance by calling the KallyRazor function passing in some configuration parameters (I'll provide these below).  Finally, we call `razor.parse` and pass it the file name to parse and the model to be passed in.  This will return back to us the contents of the parsed Razor file.  Simple.  Now for the configuration parameters.\n```\n{\n  root: <directory you want to be the root for all file references>\n}\n```\nThe root is the directory you want to be used as the root for all views.  We'll first try to do an exact lookup in the event that you've decided to pass in an absolute file path.  Otherwise, we'll prepend this root parameter to all file references.\n\n### Layouts\nOne of the cooles things about Razor is the ability to easily to layouts (templates).  Here's a sample call from Node.js\n```javascript\nvar KallyRazor = require('kally-razor');\nvar razor = KallyRazor({\n  root: __dirname + '/views/',\n  layout: 'shared/_layout.html'\n})\n```\nThe above code says that the root of the razor engine should be the views sub folder of the currently executing js file.  Next we specify the default layout (template) to be used.  Let's say we have a very basic layout file so that \"shared/_layout.html\" looks like\n```html\n@{ layout = null; }\n<html>\n  <head>\n    <title>Sample</title>\n  </head>\n  <body>\n    <h1>Some Header</h1>\n    @renderBody()\n  </body>\n</html>\n```\nThe only strange part might be `@renderBody()` which just tells Razor where to place the body content.  Then, having the following line in Node.js\n```javascript\nrazor.render('home/index.html');\n```\nAnd a file \"home/index.html\" that looks like\n```html\n<div>Yeah, it worked!</div>\n```\nthis would all yield:\n```html\n<html>\n  <head>\n    <title>Samples</title>\n  </head>\n  <body>\n    <h1>Some Header</h1>\n    <div>Yeah, it worked!</div>\n  </body>\n</html>\n```\nThat's awesome :)\n","readmeFilename":"README.md","_id":"kally-razor@0.3.6","dist":{"shasum":"acdae7bbe9ad428b1e9e36288c7b2ca63e729897","tarball":"https://registry.npmjs.org/kally-razor/-/kally-razor-0.3.6.tgz","integrity":"sha512-v/q1Km7uRee1/dpswHQki0wdXS7Mf5JEfRXyML10OdS/7X0xVNRXChMWT1SfHcc87l2iHscc+rfU4BPgvqiUiQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCw1ITO0vNobia74FE8o1i9hHC0AIDGwn54M4+OZEk6wQIgc9zijwvnf2f9w5OImfkoH9EjBgNVrGs7MZ70kOOu3do="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"nufyoot","email":"nufyoot@gmail.com"},"maintainers":[{"name":"nufyoot","email":"nufyoot@gmail.com"}]},"0.3.7":{"name":"kally-razor","version":"0.3.7","description":"Razor engine for Node","main":"lib/main.js","directories":{"test":"test"},"scripts":{"test":"make test-coveralls"},"repository":{"type":"git","url":"git://github.com/nufyoot/kally-razor.git"},"keywords":["razor","node","kally-razor","kally"],"devDependencies":{"chai":"*","mocha":"*","coveralls":"*","jscoverage":"*","mocha-lcov-reporter":"*"},"author":{"name":"Terry Tice","email":"nufyoot@gmail.com"},"readme":"kally-razor\n===========\n\n[![Build Status](https://travis-ci.org/nufyoot/kally-razor.png?branch=master)](https://travis-ci.org/nufyoot/kally-razor) [![Coverage Status](https://coveralls.io/repos/nufyoot/kally-razor/badge.png?branch=master)](https://coveralls.io/r/nufyoot/kally-razor?branch=master)\n\nMoving from C# and MVC in the .NET world, I've grown quite fond of using Razor.  Sure, there are other view engines for Node.js, but none of them quite hit what I needed.\n\n### Installing KallyRazor\nProbably the easiest method is to use npm.\n```\nnpm install kally-razor\n```\n\n### Testing KallyRazor\nOSX\n```\nmake test\n```\n\nWindows\n```\n./test.bat\n```\n\n### What's available?\nFirst, there's the basic syntax:\n```html\n<div>@model.name</div>\n```\nAll views are passed a variable named `model` which contains anything you pass to it.  More on this later.  There's also support for grouping a statement, in the event that it's a bit more complex.\n```html\n<div>@(model.firstName + ' ' + model.lastName)</div>\n```\nThe above line of code could just be written as\n```html\n<div>@model.firstName @model.lasstName</div>\n```\nbut this is just to show an example of a more complex grouping.  Now, all the examples above will evaluate the expression and immediatley output the result right into place.  But what if you need to do some calculations in the view and don't want to output anything yet?\n```html\n@{\n  var i = 12;\n}\n<div>The value of i is @i</div>\n```\n\nOf course, these are all VERY basic examples.  More complex examples to come later.\n\nNow, I mentioned above that all views have a variable named `model` passed in.  But where does the data come from?  Here's an example of how KallyRazor is called.\n```javascript\nvar KallyRazor = require('kally-razor');\nvar razor = KallyRazor({\n  root: __dirname\n});\n\nvar contents = razor.parse('./views/index.html', { firstName: 'Test', lastName: 'Testerson' });\n```\nThe above example pulls in the kally-razor module (assuming you've installed it using npm), then creates a new instance by calling the KallyRazor function passing in some configuration parameters (I'll provide these below).  Finally, we call `razor.parse` and pass it the file name to parse and the model to be passed in.  This will return back to us the contents of the parsed Razor file.  Simple.  Now for the configuration parameters.\n```\n{\n  root: <directory you want to be the root for all file references>\n}\n```\nThe root is the directory you want to be used as the root for all views.  We'll first try to do an exact lookup in the event that you've decided to pass in an absolute file path.  Otherwise, we'll prepend this root parameter to all file references.\n\n### Layouts\nOne of the cooles things about Razor is the ability to easily to layouts (templates).  Here's a sample call from Node.js\n```javascript\nvar KallyRazor = require('kally-razor');\nvar razor = KallyRazor({\n  root: __dirname + '/views/',\n  layout: 'shared/_layout.html'\n})\n```\nThe above code says that the root of the razor engine should be the views sub folder of the currently executing js file.  Next we specify the default layout (template) to be used.  Let's say we have a very basic layout file so that \"shared/_layout.html\" looks like\n```html\n@{ layout = null; }\n<html>\n  <head>\n    <title>Sample</title>\n  </head>\n  <body>\n    <h1>Some Header</h1>\n    @renderBody()\n  </body>\n</html>\n```\nThe only strange part might be `@renderBody()` which just tells Razor where to place the body content.  Then, having the following line in Node.js\n```javascript\nrazor.render('home/index.html');\n```\nAnd a file \"home/index.html\" that looks like\n```html\n<div>Yeah, it worked!</div>\n```\nthis would all yield:\n```html\n<html>\n  <head>\n    <title>Samples</title>\n  </head>\n  <body>\n    <h1>Some Header</h1>\n    <div>Yeah, it worked!</div>\n  </body>\n</html>\n```\nThat's awesome :)\n","readmeFilename":"README.md","_id":"kally-razor@0.3.7","dist":{"shasum":"cc093b9b6802de129706a2f0ed1d559e4b44214b","tarball":"https://registry.npmjs.org/kally-razor/-/kally-razor-0.3.7.tgz","integrity":"sha512-wDaHpPo4JqleaFj4So985bvR9/DRZAABy1HBLY+X45XVZid5d2RQzCTz2sN/8hge9fpz4EYUJh127ktIqzbCzg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH7ww5eBMN+lY+GKlsmAon/HNIU5981Dcc2CnJ6KGQaXAiEAjykZWkCxZeF68rN7bBwZhWoBywayRAbCZYdR3yIpgmk="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"nufyoot","email":"nufyoot@gmail.com"},"maintainers":[{"name":"nufyoot","email":"nufyoot@gmail.com"}]},"0.3.8":{"name":"kally-razor","version":"0.3.8","description":"Razor engine for Node","main":"lib/main.js","directories":{"test":"test"},"scripts":{"test":"make test-coveralls"},"repository":{"type":"git","url":"git://github.com/nufyoot/kally-razor.git"},"keywords":["razor","node","kally-razor","kally"],"devDependencies":{"chai":"*","mocha":"*","coveralls":"*","jscoverage":"*","mocha-lcov-reporter":"*"},"author":{"name":"Terry Tice","email":"nufyoot@gmail.com"},"readme":"kally-razor\n===========\n\n[![Build Status](https://travis-ci.org/nufyoot/kally-razor.png?branch=master)](https://travis-ci.org/nufyoot/kally-razor) [![Coverage Status](https://coveralls.io/repos/nufyoot/kally-razor/badge.png?branch=master)](https://coveralls.io/r/nufyoot/kally-razor?branch=master)\n\nMoving from C# and MVC in the .NET world, I've grown quite fond of using Razor.  Sure, there are other view engines for Node.js, but none of them quite hit what I needed.\n\n### Installing KallyRazor\nProbably the easiest method is to use npm.\n```\nnpm install kally-razor\n```\n\n### Testing KallyRazor\nOSX\n```\nmake test\n```\n\nWindows\n```\n./test.bat\n```\n\n### What's available?\nFirst, there's the basic syntax:\n```html\n<div>@model.name</div>\n```\nAll views are passed a variable named `model` which contains anything you pass to it.  More on this later.  There's also support for grouping a statement, in the event that it's a bit more complex.\n```html\n<div>@(model.firstName + ' ' + model.lastName)</div>\n```\nThe above line of code could just be written as\n```html\n<div>@model.firstName @model.lasstName</div>\n```\nbut this is just to show an example of a more complex grouping.  Now, all the examples above will evaluate the expression and immediatley output the result right into place.  But what if you need to do some calculations in the view and don't want to output anything yet?\n```html\n@{\n  var i = 12;\n}\n<div>The value of i is @i</div>\n```\n\nOf course, these are all VERY basic examples.  More complex examples to come later.\n\nNow, I mentioned above that all views have a variable named `model` passed in.  But where does the data come from?  Here's an example of how KallyRazor is called.\n```javascript\nvar KallyRazor = require('kally-razor');\nvar razor = KallyRazor({\n  root: __dirname\n});\n\nvar contents = razor.parse('./views/index.html', { firstName: 'Test', lastName: 'Testerson' });\n```\nThe above example pulls in the kally-razor module (assuming you've installed it using npm), then creates a new instance by calling the KallyRazor function passing in some configuration parameters (I'll provide these below).  Finally, we call `razor.parse` and pass it the file name to parse and the model to be passed in.  This will return back to us the contents of the parsed Razor file.  Simple.  Now for the configuration parameters.\n```\n{\n  root: <directory you want to be the root for all file references>\n}\n```\nThe root is the directory you want to be used as the root for all views.  We'll first try to do an exact lookup in the event that you've decided to pass in an absolute file path.  Otherwise, we'll prepend this root parameter to all file references.\n\n### Layouts\nOne of the cooles things about Razor is the ability to easily to layouts (templates).  Here's a sample call from Node.js\n```javascript\nvar KallyRazor = require('kally-razor');\nvar razor = KallyRazor({\n  root: __dirname + '/views/',\n  layout: 'shared/_layout.html'\n})\n```\nThe above code says that the root of the razor engine should be the views sub folder of the currently executing js file.  Next we specify the default layout (template) to be used.  Let's say we have a very basic layout file so that \"shared/_layout.html\" looks like\n```html\n@{ layout = null; }\n<html>\n  <head>\n    <title>Sample</title>\n  </head>\n  <body>\n    <h1>Some Header</h1>\n    @renderBody()\n  </body>\n</html>\n```\nThe only strange part might be `@renderBody()` which just tells Razor where to place the body content.  Then, having the following line in Node.js\n```javascript\nrazor.render('home/index.html');\n```\nAnd a file \"home/index.html\" that looks like\n```html\n<div>Yeah, it worked!</div>\n```\nthis would all yield:\n```html\n<html>\n  <head>\n    <title>Samples</title>\n  </head>\n  <body>\n    <h1>Some Header</h1>\n    <div>Yeah, it worked!</div>\n  </body>\n</html>\n```\nThat's awesome :)\n","readmeFilename":"README.md","_id":"kally-razor@0.3.8","dist":{"shasum":"87c20e49c077035f0c15c57f2019f4249952edf6","tarball":"https://registry.npmjs.org/kally-razor/-/kally-razor-0.3.8.tgz","integrity":"sha512-faIYGj8GjSq+g4GD+fkHGAonpGAd3dJcfSQ1JKQ2KVzYmJIbafophcYJlpBty37qLIdBCNIEi7zEaCM1S2dESA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC3Foyh8rlsq7TdiL6r9XE5QZaTbhZohaBHYLN1dwafyAIgI/gCX8CKsOeBtRL4h1G/rE+csQUrgmYvMIKx69Yjb50="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"nufyoot","email":"nufyoot@gmail.com"},"maintainers":[{"name":"nufyoot","email":"nufyoot@gmail.com"}]},"0.3.9":{"name":"kally-razor","version":"0.3.9","description":"Razor engine for Node","main":"lib/main.js","directories":{"test":"test"},"scripts":{"test":"make test-coveralls"},"repository":{"type":"git","url":"git://github.com/nufyoot/kally-razor.git"},"keywords":["razor","node","kally-razor","kally"],"devDependencies":{"chai":"*","mocha":"*","coveralls":"*","jscoverage":"*","mocha-lcov-reporter":"*"},"author":{"name":"Terry Tice","email":"nufyoot@gmail.com"},"readme":"kally-razor\n===========\n\n[![Build Status](https://travis-ci.org/nufyoot/kally-razor.png?branch=master)](https://travis-ci.org/nufyoot/kally-razor) [![Coverage Status](https://coveralls.io/repos/nufyoot/kally-razor/badge.png?branch=master)](https://coveralls.io/r/nufyoot/kally-razor?branch=master)\n\nMoving from C# and MVC in the .NET world, I've grown quite fond of using Razor.  Sure, there are other view engines for Node.js, but none of them quite hit what I needed.\n\n### Installing KallyRazor\nProbably the easiest method is to use npm.\n```\nnpm install kally-razor\n```\n\n### Testing KallyRazor\nOSX\n```\nmake test\n```\n\nWindows\n```\n./test.bat\n```\n\n### What's available?\nFirst, there's the basic syntax:\n```html\n<div>@model.name</div>\n```\nAll views are passed a variable named `model` which contains anything you pass to it.  More on this later.  There's also support for grouping a statement, in the event that it's a bit more complex.\n```html\n<div>@(model.firstName + ' ' + model.lastName)</div>\n```\nThe above line of code could just be written as\n```html\n<div>@model.firstName @model.lasstName</div>\n```\nbut this is just to show an example of a more complex grouping.  Now, all the examples above will evaluate the expression and immediatley output the result right into place.  But what if you need to do some calculations in the view and don't want to output anything yet?\n```html\n@{\n  var i = 12;\n}\n<div>The value of i is @i</div>\n```\n\nOf course, these are all VERY basic examples.  More complex examples to come later.\n\nNow, I mentioned above that all views have a variable named `model` passed in.  But where does the data come from?  Here's an example of how KallyRazor is called.\n```javascript\nvar KallyRazor = require('kally-razor');\nvar razor = KallyRazor({\n  root: __dirname\n});\n\nvar contents = razor.parse('./views/index.html', { firstName: 'Test', lastName: 'Testerson' });\n```\nThe above example pulls in the kally-razor module (assuming you've installed it using npm), then creates a new instance by calling the KallyRazor function passing in some configuration parameters (I'll provide these below).  Finally, we call `razor.parse` and pass it the file name to parse and the model to be passed in.  This will return back to us the contents of the parsed Razor file.  Simple.  Now for the configuration parameters.\n```\n{\n  root: <directory you want to be the root for all file references>\n}\n```\nThe root is the directory you want to be used as the root for all views.  We'll first try to do an exact lookup in the event that you've decided to pass in an absolute file path.  Otherwise, we'll prepend this root parameter to all file references.\n\n### Layouts\nOne of the cooles things about Razor is the ability to easily to layouts (templates).  Here's a sample call from Node.js\n```javascript\nvar KallyRazor = require('kally-razor');\nvar razor = KallyRazor({\n  root: __dirname + '/views/',\n  layout: 'shared/_layout.html'\n})\n```\nThe above code says that the root of the razor engine should be the views sub folder of the currently executing js file.  Next we specify the default layout (template) to be used.  Let's say we have a very basic layout file so that \"shared/_layout.html\" looks like\n```html\n@{ layout = null; }\n<html>\n  <head>\n    <title>Sample</title>\n  </head>\n  <body>\n    <h1>Some Header</h1>\n    @renderBody()\n  </body>\n</html>\n```\nThe only strange part might be `@renderBody()` which just tells Razor where to place the body content.  Then, having the following line in Node.js\n```javascript\nrazor.render('home/index.html');\n```\nAnd a file \"home/index.html\" that looks like\n```html\n<div>Yeah, it worked!</div>\n```\nthis would all yield:\n```html\n<html>\n  <head>\n    <title>Samples</title>\n  </head>\n  <body>\n    <h1>Some Header</h1>\n    <div>Yeah, it worked!</div>\n  </body>\n</html>\n```\nThat's awesome :)\n","readmeFilename":"README.md","_id":"kally-razor@0.3.9","dist":{"shasum":"fe759ef21feee44067bf137e1d5971ed7d4b8ac0","tarball":"https://registry.npmjs.org/kally-razor/-/kally-razor-0.3.9.tgz","integrity":"sha512-RGpJQIOWm9MvHa/TYjekYzg2NPjGpCphe69pDnS7sTLa9oCz7HLO7vCOLbtC6bUAvPT1NPXIxeuSIOJXE+q6/Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG3PEJ3qIO4NmciMvqWz3ydiwQhVYzVKtiHfOgEUz071AiEA+8pA6bUeyrFusdQC9RxeKe6jjp/Of4HDy4X/xK3aaGE="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"nufyoot","email":"nufyoot@gmail.com"},"maintainers":[{"name":"nufyoot","email":"nufyoot@gmail.com"}]},"0.3.10":{"name":"kally-razor","version":"0.3.10","description":"Razor engine for Node","main":"lib/main.js","directories":{"test":"test"},"scripts":{"test":"make test-coveralls"},"repository":{"type":"git","url":"git://github.com/nufyoot/kally-razor.git"},"keywords":["razor","node","kally-razor","kally"],"devDependencies":{"chai":"*","mocha":"*","coveralls":"*","jscoverage":"*","mocha-lcov-reporter":"*"},"author":{"name":"Terry Tice","email":"nufyoot@gmail.com"},"readme":"kally-razor\n===========\n\n[![Build Status](https://travis-ci.org/nufyoot/kally-razor.png?branch=master)](https://travis-ci.org/nufyoot/kally-razor) [![Coverage Status](https://coveralls.io/repos/nufyoot/kally-razor/badge.png?branch=master)](https://coveralls.io/r/nufyoot/kally-razor?branch=master)\n\nMoving from C# and MVC in the .NET world, I've grown quite fond of using Razor.  Sure, there are other view engines for Node.js, but none of them quite hit what I needed.\n\n### Installing KallyRazor\nProbably the easiest method is to use npm.\n```\nnpm install kally-razor\n```\n\n### Testing KallyRazor\nOSX\n```\nmake test\n```\n\nWindows\n```\n./test.bat\n```\n\n### What's available?\nFirst, there's the basic syntax:\n```html\n<div>@model.name</div>\n```\nAll views are passed a variable named `model` which contains anything you pass to it.  More on this later.  There's also support for grouping a statement, in the event that it's a bit more complex.\n```html\n<div>@(model.firstName + ' ' + model.lastName)</div>\n```\nThe above line of code could just be written as\n```html\n<div>@model.firstName @model.lasstName</div>\n```\nbut this is just to show an example of a more complex grouping.  Now, all the examples above will evaluate the expression and immediatley output the result right into place.  But what if you need to do some calculations in the view and don't want to output anything yet?\n```html\n@{\n  var i = 12;\n}\n<div>The value of i is @i</div>\n```\n\nOf course, these are all VERY basic examples.  More complex examples to come later.\n\nNow, I mentioned above that all views have a variable named `model` passed in.  But where does the data come from?  Here's an example of how KallyRazor is called.\n```javascript\nvar KallyRazor = require('kally-razor');\nvar razor = KallyRazor({\n  root: __dirname\n});\n\nvar contents = razor.parse('./views/index.html', { firstName: 'Test', lastName: 'Testerson' });\n```\nThe above example pulls in the kally-razor module (assuming you've installed it using npm), then creates a new instance by calling the KallyRazor function passing in some configuration parameters (I'll provide these below).  Finally, we call `razor.parse` and pass it the file name to parse and the model to be passed in.  This will return back to us the contents of the parsed Razor file.  Simple.  Now for the configuration parameters.\n```\n{\n  root: <directory you want to be the root for all file references>\n}\n```\nThe root is the directory you want to be used as the root for all views.  We'll first try to do an exact lookup in the event that you've decided to pass in an absolute file path.  Otherwise, we'll prepend this root parameter to all file references.\n\n### Layouts\nOne of the cooles things about Razor is the ability to easily to layouts (templates).  Here's a sample call from Node.js\n```javascript\nvar KallyRazor = require('kally-razor');\nvar razor = KallyRazor({\n  root: __dirname + '/views/',\n  layout: 'shared/_layout.html'\n})\n```\nThe above code says that the root of the razor engine should be the views sub folder of the currently executing js file.  Next we specify the default layout (template) to be used.  Let's say we have a very basic layout file so that \"shared/_layout.html\" looks like\n```html\n@{ layout = null; }\n<html>\n  <head>\n    <title>Sample</title>\n  </head>\n  <body>\n    <h1>Some Header</h1>\n    @renderBody()\n  </body>\n</html>\n```\nThe only strange part might be `@renderBody()` which just tells Razor where to place the body content.  Then, having the following line in Node.js\n```javascript\nrazor.render('home/index.html');\n```\nAnd a file \"home/index.html\" that looks like\n```html\n<div>Yeah, it worked!</div>\n```\nthis would all yield:\n```html\n<html>\n  <head>\n    <title>Samples</title>\n  </head>\n  <body>\n    <h1>Some Header</h1>\n    <div>Yeah, it worked!</div>\n  </body>\n</html>\n```\nThat's awesome :)\n","readmeFilename":"README.md","_id":"kally-razor@0.3.10","dist":{"shasum":"7e98aa0d5f03a52da32150ea9ba302906815d5fc","tarball":"https://registry.npmjs.org/kally-razor/-/kally-razor-0.3.10.tgz","integrity":"sha512-RJmhzvTsjW67GBcIjb7bc5k5He4mj4raqdpuB1Ekueb+mDgNWRgbW2D4m7lWBtNYx8o+A1V3CxHMPU5I4GnY9Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+h4vGK6DodtC+AqAOAzznF5VEiCilWj6Hvmu5/OGSCgIgM/0idl+fEMLkMeNu4R0QBH7SZJAc6vAs10veh3oowWk="}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"nufyoot","email":"nufyoot@gmail.com"},"maintainers":[{"name":"nufyoot","email":"nufyoot@gmail.com"}]}},"readme":"kally-razor\n===========\n\n[![Build Status](https://travis-ci.org/nufyoot/kally-razor.png?branch=master)](https://travis-ci.org/nufyoot/kally-razor)\n\nLooking for an awesome Razor engine for Node.  Why not roll your own?  That's my plan...\n","maintainers":[{"name":"nufyoot","email":"nufyoot@gmail.com"}],"time":{"modified":"2022-06-19T07:46:53.144Z","created":"2013-05-15T13:00:47.526Z","0.0.1":"2013-05-15T13:00:49.998Z","0.0.2":"2013-05-15T13:09:49.845Z","0.0.3":"2013-05-15T13:18:24.287Z","0.0.5":"2013-05-16T19:35:03.320Z","0.1.0":"2013-05-20T00:02:39.905Z","0.2.0":"2013-05-20T02:14:47.038Z","0.2.1":"2013-05-21T17:02:46.219Z","0.3.0":"2013-05-28T00:53:47.763Z","0.3.1":"2013-05-28T03:18:26.547Z","0.3.2":"2013-05-28T03:23:57.344Z","0.3.3":"2013-05-28T03:30:28.340Z","0.3.4":"2013-06-02T23:53:40.287Z","0.3.5":"2013-06-03T00:31:11.149Z","0.3.6":"2013-06-03T00:37:57.306Z","0.3.7":"2013-06-03T01:51:37.391Z","0.3.8":"2013-06-03T02:02:12.331Z","0.3.9":"2013-06-03T14:02:50.793Z","0.3.10":"2013-06-24T03:27:50.363Z"},"author":{"name":"Terry Tice","email":"nufyoot@gmail.com"},"repository":{"type":"git","url":"git://github.com/nufyoot/kally-razor.git"}}