<commit_before>var _ = require('lodash');
var myArgs = require('optimist')
  .usage('Usage: $0 path/to/files --templates=path/to/templates --output=path/to/output/folder')
  .demand(1)
  .argv;

var filePath = myArgs._[0];
var docGenerator = require('./lib/default-setup');
var renderDocs = docGenerator.renderDocsFactory(myArgs.templates, myArgs.output);

// Extra data
var git = {
  // TODO: Get this from somewhere
  tag: "v1.2.6-build.1989+sha.b0474cb"
};

// Main work
console.log('Reading files from ', filePath);
docGenerator.readFiles(filePath)

  .then(function(docs) {
    console.log('Read', docs.length, 'docs');
    docs = docGenerator.processDocs(docs);
    return renderDocs(docs, {git: git});
  })

  .then(function(renderedFilePaths) {
    _.forEach(renderedFilePaths, function(renderedFilePath) {
      console.log('Rendered doc', renderedFilePath);
    });
  })
<commit_msg>chore(render-docs): list generated doc ids<commit_after>var _ = require('lodash');
var myArgs = require('optimist')
  .usage('Usage: $0 path/to/files --templates=path/to/templates --output=path/to/output/folder')
  .demand(1)
  .argv;

var filePath = myArgs._[0];
var docGenerator = require('./lib/default-setup');
var renderDocs = docGenerator.renderDocsFactory(myArgs.templates, myArgs.output);

// Extra data
var git = {
  // TODO: Get this from somewhere
  tag: "v1.2.6-build.1989+sha.b0474cb"
};

// Main work
console.log('Reading files from ', filePath);
docGenerator.readFiles(filePath)

  .then(function(docs) {
    console.log('Read', docs.length, 'docs');
    docs = docGenerator.processDocs(docs);
    _.forEach(docs, function(doc) {
      console.log('Processed doc', doc.id);
    });
    return renderDocs(docs, {git: git});
  })

  .then(function(renderedFilePaths) {
    _.forEach(renderedFilePaths, function(renderedFilePath) {
      console.log('Rendered doc', renderedFilePath);
    });
  })

{'fraction_non_alphanumeric': 0.16342616920651604, 'fraction_numerical': 0.014713610089332634, 'mean_word_length': 4.230769230769231, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1954870', 'n_tokens_mistral': 656, 'n_tokens_neox': 625, 'n_words': 121}