2.0.0 • Published 4 years ago

jstml v2.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 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

4 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago