div.fooClass {
if (user) {
div {
i > 'User '
foo {
'~[user]'
}
}
}
}
.fooClass>if(user)>div{i>'User 'foo>'~[user]'}
import foo from 'foo.mask';
footer > foo;
module path='foo.mask' {
define foo {
span > 'Lorem Ipsum'
}
}
import foo from 'foo.mask';
footer > foo;
Optimizer itself should be defined in settings so that this library runs all optimizers via the template. For Instance markdown
plugin can convert Markdown markup to html for better client performance.
section > :md > """
### Hello
_Baz_
"""
section > :html > """
<h6>Hello</h6>
<i>Baz</i>
"""
npm install mask-optimizer
var Optimizer = require('mask-optimizer');
// template string
var minified = Minifier.optimize(template);
// files
Minifier.optimizeFiles(String|Array|Glob files, String|Array output);
Minifier.optimizeFiles('views/foo.mask'); // output in `views/foo.min.mask`
Minifier.optimizeFiles('views/*.mask'); // output in `views/*.min.mask`
Minifier.optimizeFiles('foo.mask', '/release/foo.mask');
Use this as a Plugin for io.File.read
to minify Mask markup
-
when building Single-Page Application with the Atma.Toolkit, all the templates are embedded and minified into the resulting output html file.
-
when building Atma Server Application, all templates are minified and combined into single html file for each Page ID
cd my-project
atma plugin install mask-minify
atma plugin install mask-minify -g
This will install
mask-minify
module from the NPM repository, and will update currentpackage.json
.
©️ - 2015 - The Atma.js Project - MIT