How to use hercule - 2 common examples

To help you get started, we’ve selected a few hercule examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jamesramsay / hercule / examples / gulp / gulpfile.js View on Github external
if (file.isNull()) {
        return callback(null, file);
      }

      if (file.isBuffer()) {
        hercule.transcludeString(file.contents.toString(encoding), options, function(err, output) {
          if (err) {
            return callback(err, null)
          }
          file.contents = new Buffer(output);
          return callback(null, file);
        })
      }

      if (file.isStream()) {
        var transcluder = new hercule.TranscludeStream(options);
        file.contents = file.contents.pipe(transcluder);
        return callback(null, file);
      }
    });
  };
github jamesramsay / hercule / examples / gulp / gulpfile.js View on Github external
return through.obj( function(file, encoding, callback) {
      if (file.isNull()) {
        return callback(null, file);
      }

      if (file.isBuffer()) {
        hercule.transcludeString(file.contents.toString(encoding), options, function(err, output) {
          if (err) {
            return callback(err, null)
          }
          file.contents = new Buffer(output);
          return callback(null, file);
        })
      }

      if (file.isStream()) {
        var transcluder = new hercule.TranscludeStream(options);
        file.contents = file.contents.pipe(transcluder);
        return callback(null, file);
      }
    });
  };

hercule

Markdown, API Blueprint and string transclusion

MIT
Latest version published 4 years ago

Package Health Score

53 / 100
Full package analysis