fbrctr / fabricator

A tool for building website UI toolkits and style guides
http://fbrctr.github.io/
MIT License
1.11k stars 124 forks source link

adding new helpers like embed from handlebars does not work #317

Open burza opened 5 years ago

burza commented 5 years ago

i cant get running the code from the docs

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

My current code differs from the docs like this:

// assembly
function assembler(done) {
  fabAssemble({
    logErrors: config.dev,
    dest: config.dest,
    helpers: {
      // {{ default description "string of content used if description var is undefined" }}
      default: function defaultFn(...args) {
        return args.find(value => !!value);
      },
      markdown: require('helper-markdown'),

and then i'am getting still the following error msg:

[11:28:11] Error: Cannot find module 'helper-markdown'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:611:15)
    at Function.Module._load (internal/modules/cjs/loader.js:537:25)
    at Module.require (internal/modules/cjs/loader.js:665:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at assembler (/Users/burza/Projekte/ks-styleguide/gulpfile.js:160:17)
    at bound (domain.js:393:14)
    at runBound (domain.js:406:12)
    at asyncRunner (/Users/burza/Projekte/ks-styleguide/node_modules/async-done/index.js:55:18)
    at processTicksAndRejections (internal/process/next_tick.js:74:9)

how is it possible to add additionaly helpers like the embed helper?

emkajeej commented 5 years ago

do you have helper-markdown in your node_modules? If not, you might need to install that first.