bit-docs/lib/process/process module

Processes a FileEventEmitter and returns a promise.

process(fileEventEmitter, siteConfig)

Handles file match events from the FileEventEmitter by passing file source to bit-docs/lib/process/file which adds new DocObjects to the DocMap.

Parameters

  1. fileEventEmitter {FileEventEmitter}:

    An event emitter that dispatches events with files to process.

  2. siteConfig {Object}:

    An siteConfig object used to configure the behavior of bit-docs.

    • tags {String}

      If tags is a string, that file will be required. It should export a function that takes the default TagCollection object and returns the tags that will be used. Example module:

      module.exports = function(tags) {
             tags = _.extend({},tags);
          tags.customTag = {add: function(){}, ...}
          return tags;
      };
      

Returns

{Promise<DocMap>}:

A DocMap that contains the DocObjects created from the processed files.