Skip to content
This repository was archived by the owner on Jul 24, 2025. It is now read-only.

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

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

About

Javascript template pre-compiler with namespacing support.

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages