/**
 * Default markup for excerpt of documentation.
 * @module Excerpt
 */

//
// Run the script in strict mode.
//
'use strict';

//
// Required modules.
//
var mustache = require('mustache');

/**
 * Excerpt constructor.
 *
 * @alias module:Excerpt
 * @constructor
 * @param {Object} data
 * @param {Function} transform
 * @public
 */
function Excerpt(data, transform) {
  if (!('file' in data)) throw new Error('invalid excerpt data, file stats missing');
  if ('function' === typeof transform) data = transform(data);

  for (var key in data) {
    this[key] = data[key];
  }
}

Excerpt.prototype = {
  /**
   * Define an ID by referencing the file path.
   *
   * @returns {String} relative path as ID.
   * @public
   */
  get id() {
    return this.file.path;
  },

  /**
   * Render the excerpt by template.
   *
   * @param {String} template mustache template
   * @returns {String} compiled content
   * @public
   */
  render: function render(template) {
    return mustache.render(template, this);
  }
};

//
// Expose the constructor.
//
module.exports = Excerpt;

@@ -45,16 +45,19 @@
 tation.%0A
+ *%0A
  * @modu
@@ -158,24 +158,26 @@
 %0A//%0Avar 
-mustache
+handlebars
  = requi
@@ -180,24 +180,26 @@
 equire('
-mustache
+handlebars
 ');%0A%0A/**
@@ -206,27 +206,137 @@
 %0A * 
-Excerpt constructor
+Construct a new Excerpt which is synonym for one file/page of the%0A * documentation. An Excerpt can be rendered against a template
 .%0A *
@@ -350,15 +350,8 @@
 ias 
-module:
 Exce
@@ -397,39 +397,123 @@
 data
-%0A * @param %7BFunction%7D transform
+ parsed content to provide to this excerpt%0A * @param %7BFunction%7D transform process and transform data before storing
 %0A * 
@@ -807,20 +807,24 @@
   * 
-Define an ID
+An ID is defined
  by 
@@ -897,17 +897,16 @@
 th as ID
-.
 %0A   * @p
@@ -1028,41 +1028,36 @@
 am %7B
-String%7D template mustache templat
+Cataloger%7D cataloger instanc
 e%0A  
@@ -1143,55 +1143,88 @@
 der(
-template) %7B%0A    return mustache.render(
+cataloger) %7B%0A    this.instance = this.constructor;%0A    return cataloger.
 template
 , th
@@ -1223,14 +1223,17 @@
 late
-, 
+(
 this
+, %7B%7D
 );%0A 

improve Excerpt module