<html>
<head>
<include>news-article</include>
<include>page-header</include>
<include>page-footer</include>
<include>news-page</include>
<include>lorem</include>
</head>
<body>
<page-header/>
<news-page>
<news-article demo>
<author>Jane Doe</author>
<title>Test</title>
<body><lorem/></body>
</news-article>
</news-page>
<page-footer/>
</body>
</html>
- Templates look like HTML
- Easily build large templates out of small ones
- Clean separation of languages: javascript is javascript and HTML is HTML. Get rid of HTML snippets inside javascript.
- Less logic than "logicless" templates. It doesn't turn HTML into a programming language.
- Use stand-alone or with a framework, e.g. backbone, meteor, etc.
- Use "demo" elements to preview a design--they go away when compiled for production.
- Pass-through parameters are easier than "partials." Documentation and Example
Preview/Demo*
- Download modest-preview.js.
- Put
<script src="modest-preview.js"></script>
in thehead
of your html file (after jquery).
Compile to Production*
- Install node.js (once)
npm install -g modest
(once)- Go into your project directory
- type
modest
OR use grunt-modest
https://github.com/goalzen/modest/issues
modest-preview.js runs in the browser, and depends on jquery.
To compile to production, you need:
- node.js
- Python
- A C++ compiler
See the installation instructions for node-gyp for more information.
Change directories into your local clone and type
npm install
to get the node.js dependencies. After you make your changes, make sure your tests are run by test/all.js. The tests use vows. Make sure the tests still pass by running
npm test
Permission is granted under the MIT license.