Skip to content

RequireJS Jade plugin that supports client-side Jade rendering, including template inheritance.

License

Notifications You must be signed in to change notification settings

pheuter/require-j

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

require-j

RequireJS Jade plugin that supports client-side Jade rendering, including template inheritance.

About

require-j attempts to fill the gap left by porting jade over to the client, namely the ability to use template inheritance constructs such as extends and include.

To load templates, jade depends on certain node modules (such as path and fs) to exist during runtime and uses require to access them. The problem is that node's require is replaced by RequireJS's require which has no notion of node modules.

To address this issue, require-j overrides jade's default parseInclude and parseExtends functions with a variant that utilizes RequireJS APIs, such as toUrl and fetchText. This is achieved without any modifications to the jade library.

Todo

  • Refactor load to support dynamic loading from the browser

Dependencies

Setup

Initialize jade submodule

$ git submodule init
$ git submodule update

Install dependencies

$ npm install

Build plugin and demo app

$ cake build

Will create lib/j.js and demo/main.out.js

Usage

Check out the demo app in demo/ for a sample app utilizing require-j

About

RequireJS Jade plugin that supports client-side Jade rendering, including template inheritance.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published