2.0.0 • Published 6 years ago

jstml v2.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

jstml

Javascript template pre-compiler with namespacing support.

install

npm install -g jstml

usage

jstml --dir=src/templates --namespace=MyApp.templates > templates.js
/src
    /templates
        /layouts
            admin.jstml
            main.jstml
        _list-item.jstml
        home.jstml
        posts.jstml

Above folder structure will output a .js file like this:

MyApp.templates = MyApp.templates || {};
MyApp.templates.layouts = MyApp.templates.layouts || {};
MyApp.templates.layouts.admin = function admin (data) {
    // template content here.
};

MyApp.templates = MyApp.templates || {};
MyApp.templates.layouts = MyApp.templates.layouts || {};
MyApp.templates.layouts.main = function main (data) {
    // template content here.
};

MyApp.templates = MyApp.templates || {};
MyApp.templates.layouts._listItem = function _listItem (data) {
    // template content here.
};

MyApp.templates = MyApp.templates || {};
MyApp.templates.layouts.home = function home (data) {
    // template content here.
};

MyApp.templates = MyApp.templates || {};
MyApp.templates.layouts.posts = function posts (data) {
    // template content here.
};

defaults

--dir=.
--namespace=APP.TEMPLATE
2.0.0

6 years ago

1.2.2

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago