code: function merge(docs){
    var byFullId = {};
  
    docs.forEach(function(doc) {
      byFullId[doc.section + '/' + doc.id] = doc;
    });
  
    for(var i = 0; i < docs.length;) {
      if (findParent(docs[i], 'method') || findParent(docs[i], 'property') || findParent(docs[i], 'event')) {
        docs.splice(i, 1);
      } else {
        i++;
      }
    }
  
    function findParent(doc, name) {
      var parentName = doc[name + 'Of'];
      if (!parentName) return false;
  
      var parent = byFullId[doc.section + '/' + parentName];
      if (!parent)
        throw new Error("No parent named '" + parentName + "' for '" +
          doc.name + "' in @" + name + "Of.");
  
      var listName = (name + 's').replace(/ys$/, 'ies');
      var list = parent[listName] = (parent[listName] || []);
      list.push(doc);
      list.sort(orderByName);
      return true;
    }
  
    function orderByName(a, b){
      return a.name < b.name ? -1 : (a.name > b.name ? 1 : 0);
    }
  }
docs: ////////////////////////////////////////////////////////