Helpers

How to add your own Handlebars helpers

Add your own helpers to the Fabricator assembly engine by defining them in the assemble task in gulpfile.js:

// assemble
gulp.task('assemble', function(done) {
    assemble({
        helpers: {
            markdown: require('helper-markdown')
        }
    });
    done();
});

This adds the helper-markdown helper, which can be used like:

{{#markdown}}
    # Markdown!
{{/markdown}}

Learn more about Handlebars helpers.

Built-in helpers

There are some useful helpers already built into Fabricator.

iterate

{{#iterate 20}}
    <li>List Item {{@index}}</li>
{{/iterate}}

material

{{material name context}}