/MaskJS

[~ less] Markup | Template | HMVC

Primary LanguageJavaScript


mask.js — is a markup | template | HMVC engine


.container {
	h4 > 'Title'
	section.content data-id='myID' {
		span >'Hello ~[name]!'
	}
	:custom > button x-signal='click: changeName' {
		'~[bind: name]'
	}
}
Features:
<ul>
	<li>Performance — (mobile CPUs in mind) - doesnt require precompilation</li>
	<li>Custom tags / Custom Value Processors / Custom Attributes</li>
	<li>DOM Based — [Template &rarr; JSON AST &rarr; Document Fragment &rarr; Live DOM].
	This allows custom tags to render themselfs much faster in compare to rendering into placeholder in dom</li>
	<li>For server and browsers</li>
</ul>

maskFiddle

Documentation

Default build contains:

Performance Tests

###Changelog

v0.7.5
  • Binded Percent Handler, 'each' example:
    %% each="users" { //template
v0.7.0
  • Expressions parser. Samples:
    ~[:controllerFunction(userName.toUpperCase()) + ';']
    ~[:user && user.id || "Log in"]
    Variables/Functions look up:
    1. model
    2. cntx
    3. controller
    4. up in controllers tree
v0.6.95
  • Use ~[] for string interpolation instead of #{}, as mask templates are already overloaded with '#','{' and '}' usage
    mask.setInterpolationQuotes('#{','}') - for fallback (or any other start/end, caution - start should be of 2 chars and the end of 1)
v0.6.9
  • // for line comments in templates
  • ++ parser: performance / preserve new lines
  • ++ custom handlers: use .renderStart/.renderEnd for better performance
  • embed bindings / % handler [if,else,each]/ compo / jmask libraries
</td>