index.js
function render(source, config, options) {
  config = config || {};
  config.raml2HtmlVersion = pjson.version;

  // Check if option is old boolean `validation` to keep backward compatibility
  if (typeof options === 'boolean') {
    options = {
      validate: options,
    };
  }

  if (options === undefined) {
    options = {
      validate: false,
    };
  }

  return raml2obj
    .parse(source, {
      validate: options.validate,
      extensionsAndOverlays: options.extensionsAndOverlays,
    })
    .then(ramlObj => {
      if (config.processRamlObj) {
        return config.processRamlObj(ramlObj, config, options).then(html => {
          if (config.postProcessHtml) {
            return config.postProcessHtml(html, config, options);
          }
          return html;
        });
      }

      return ramlObj;
    });
}
function render(source, config, options) {
  config = config || {};
  config.raml2HtmlVersion = pjson.version;

  // Check if option is old boolean `validation` to keep backward compatibility
  if (typeof options === 'boolean') {
    options = {
      validate: options,
    };
  }

  if (options === undefined) {
    options = {
      validate: false,
    };
  }

  return raml2obj
    .parse(source, {
      validate: options.validate,
      extensionsAndOverlays: options.extensionsAndOverlays,
    })
    .then(ramlObj => {
      if (config.processRamlObj) {
        return config.processRamlObj(ramlObj, config, options).then(html => {
          if (config.postProcessHtml) {
            return config.postProcessHtml(html, config, options);
          }
          return html;
        });
      }

      return ramlObj;
    });
}
function render ( source , config , options ) { config = config || { } ; config . raml2HtmlVersion = pjson . version ; // Check if option is old boolean `validation` to keep backward compatibility if ( typeof options === 'boolean' ) { options = { validate : options , } ; } if ( options === undefined ) { options = { validate : false , } ; } return raml2obj . parse ( source , { validate : options . validate , extensionsAndOverlays : options . extensionsAndOverlays , } ) . then ( ramlObj => { if ( config . processRamlObj ) { return config . processRamlObj ( ramlObj , config , options ) . then ( html => { if ( config . postProcessHtml ) { return config . postProcessHtml ( html , config , options ) ; } return html ; } ) ; } return ramlObj ; } ) ; }
Render the source RAML object using the config's processOutput function

The config object should contain at least the following property:
processRamlObj: function that takes the raw RAML object and returns a promise with the rendered HTML

@param {(String|Object)} source - The source RAML file. Can be a filename, url, or an already-parsed RAML object.
@param {Object} config
@param {Object} options
@param {Function} config.processRamlObj
@returns a promise
Render the source RAML object using the config s processOutput function