<commit_before>'use strict';
/* global module, require, __dirname */

var isEmptyObject = require('is-empty-object');
var assign = require('object-assign');
var through2 = require('through2');
var traverse = require('traverse');
var pretty = require('pretty');
var mkdirp = require('mkdirp');
var marked = require('marked');
var path = require('path');
var fs = require('fs');



/**
 * Takes the jade-doc stream 
 * and generates a pretty html file.
 */

function JadeDocHTML(options){

  if(typeof options === 'undefined'){
    throw new Error('Jade doc html requires a settings object.');
  }

  if(typeof options.output === 'undefined'){
    throw new Error('Jade doc html requires settings.output to be set.');
  }

  // options
  options = assign({
    input: null,
    output: null
  }, options);

  var isInit = true;

  // create output stream
  mkdirp.sync(path.dirname(options.output));
  var output = fs.createWriteStream(options.output);
  output.on('close', function(){
    stream.emit('complete');
  }.bind(this));


  // read template html file
  var template = fs.createReadStream(__dirname +'/template.html');
  var templateHtml;

  template.on('data', function(data){
    // break template file up in 2 parts
    templateHtml = data.toString().split('JADE_DOC_DATA');

    // add first part of template html
    output.write(templateHtml[0]);
  });



  /**
   * Create js object to be placed inside html file
   */
  
  function createSnippet(obj){

    var line = [];

    // add trailing comma for all items but the first
    if(!isInit){
      line.push(',');
    }

    // create pretty html
    obj.output = pretty(obj.output);

    obj.name = obj.meta.name;
    obj.description = obj.meta.description;
    // obj.arguments = tableify(obj.meta.arguments);

    delete obj.meta.name;
    delete obj.meta.description;
    // delete obj.meta.arguments;

    // traverse all arguments
    // and indent according to level
    var spaces;
    var arg;
    var rest = '';
<commit_msg>remove commented code<commit_after>'use strict';
/* global module, require, __dirname */

var isEmptyObject = require('is-empty-object');
var assign = require('object-assign');
var through2 = require('through2');
var traverse = require('traverse');
var pretty = require('pretty');
var mkdirp = require('mkdirp');
var marked = require('marked');
var path = require('path');
var fs = require('fs');



/**
 * Takes the jade-doc stream 
 * and generates a pretty html file.
 */

function JadeDocHTML(options){

  if(typeof options === 'undefined'){
    throw new Error('Jade doc html requires a settings object.');
  }

  if(typeof options.output === 'undefined'){
    throw new Error('Jade doc html requires settings.output to be set.');
  }

  // options
  options = assign({
    input: null,
    output: null
  }, options);

  var isInit = true;

  // create output stream
  mkdirp.sync(path.dirname(options.output));
  var output = fs.createWriteStream(options.output);
  output.on('close', function(){
    stream.emit('complete');
  }.bind(this));


  // read template html file
  var template = fs.createReadStream(__dirname +'/template.html');
  var templateHtml;

  template.on('data', function(data){
    // break template file up in 2 parts
    templateHtml = data.toString().split('JADE_DOC_DATA');

    // add first part of template html
    output.write(templateHtml[0]);
  });



  /**
   * Create js object to be placed inside html file
   */
  
  function createSnippet(obj){

    var line = [];

    // add trailing comma for all items but the first
    if(!isInit){
      line.push(',');
    }

    // create pretty html
    obj.output = pretty(obj.output);

    obj.name = obj.meta.name;
    obj.description = obj.meta.description;

    delete obj.meta.name;
    delete obj.meta.description;

    // traverse all arguments
    // and indent according to level
    var spaces;
    var arg;
    var rest = '';

{'fraction_non_alphanumeric': 0.1400560224089636, 'fraction_numerical': 0.002037178507766743, 'mean_word_length': 3.1831735889243875, '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': '7495459', 'n_tokens_mistral': 1195, 'n_tokens_neox': 1132, 'n_words': 348}