<commit_before>"use strict";
var fs = require('fs');
var path = require('path');
var async = require('async');
var marked = require('marked');
var hljs = require('highlight.js');
var nunjucks = require('nunjucks');
var unidecode = require('unidecode');

var FILE_ENCODING = 'utf-8';

var dependencies = {};
var verbose;
var fileTools;

marked.setOptions({
	gfm: true,
	tables: true,
	breaks: true,
	smartypants: true,
	highlight: function (code, lang) {
		if(lang) {
			return hljs.highlight(lang, code).value;
		} else {
			return "<code>" + code + "</code>";
		}
	}
});

var getGoodName = function(filename) {
	var name = path.basename(filename, ".md");
	return unidecode(name)
		.replace(/\s+/g, '-')
		.replace(/[^a-z0-9-]+/gi,'')
		.toLowerCase();
};

var Dome = function(fuller, plan) {
	if(!verbose) {
		verbose = fuller.verbose;
	}

	if(!fileTools) {
		fileTools = fuller.getTool('files');
	}

	this.dst = plan.defaults.dst;
	this.home = plan.defaults.home;
	this.title = plan.defaults.title;

	this.tasks = this.getFullTasks(plan.tasks);

	this.defaultTemplate = plan.defaults.defaultTemplate;
	var templatePath = path.join(fuller.pathes.home, plan.defaults.templates);
	this.env = new nunjucks.Environment(new nunjucks.FileSystemLoader(templatePath));
};

Dome.prototype.buildDependencies = function() {
	var dir;

	for(dir in this.tasks) {
		var task = this.tasks[dir];
		fileTools.addDependence(dependencies, task.content, dir);
	}
};
<commit_msg>Added template file to watch mode<commit_after>"use strict";
var fs = require('fs');
var path = require('path');
var async = require('async');
var marked = require('marked');
var hljs = require('highlight.js');
var nunjucks = require('nunjucks');
var unidecode = require('unidecode');

var FILE_ENCODING = 'utf-8';

var dependencies = {};
var verbose;
var fileTools;

marked.setOptions({
	gfm: true,
	tables: true,
	breaks: true,
	smartypants: true,
	highlight: function (code, lang) {
		if(lang) {
			return hljs.highlight(lang, code).value;
		} else {
			return "<code>" + code + "</code>";
		}
	}
});

var getGoodName = function(filename) {
	var name = path.basename(filename, ".md");
	return unidecode(name)
		.replace(/\s+/g, '-')
		.replace(/[^a-z0-9-]+/gi,'')
		.toLowerCase();
};

var Dome = function(fuller, plan) {
	if(!verbose) {
		verbose = fuller.verbose;
	}

	if(!fileTools) {
		fileTools = fuller.getTool('files');
	}

	this.dst = plan.defaults.dst;
	this.home = plan.defaults.home;
	this.title = plan.defaults.title;

	this.tasks = this.getFullTasks(plan.tasks);

	this.defaultTemplate = plan.defaults.defaultTemplate;
	this.templatesPath = path.join(fuller.pathes.home, plan.defaults.templates);
	this.env = new nunjucks.Environment(new nunjucks.FileSystemLoader(this.templatesPath));
};

Dome.prototype.buildDependencies = function() {
	var dir;

	for(dir in this.tasks) {
		var task = this.tasks[dir];
		fileTools.addDependence(dependencies, path.join(this.templatesPath, (task.template || this.defaultTemplate)), dir);
		fileTools.addDependence(dependencies, task.content, dir);
	}
};

{'fraction_non_alphanumeric': 0.1693864229765013, 'fraction_numerical': 0.0019582245430809398, 'mean_word_length': 4.613553113553113, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4748059', 'n_tokens_mistral': 1127, 'n_tokens_neox': 1066, 'n_words': 223}