<commit_before>var templates = require('./templates'),
    modules = require('../../../lib/modules'),
    async = require('../../../deps/async'),
    fs = require('fs');


/**
 * Loads module directories specified in kanso.json and adds the modules
 * to the document.
 */

module.exports = {
    before: 'modules/attachment',
    run: function (root, path, settings, doc, callback) {

        // load the dust source code
        var dust_path = __dirname + '/../../../deps/dustjs/lib/dust.js';
        fs.readFile(dust_path, function (err, dust_src) {
            if (err) {
                return callback(err);
            }

            var template_str = '';
            for (var k in doc.templates) {
                template_str += doc.templates[k];
            }
            delete doc.templates;

            // load the templates module bootstrap code
            // TODO move this to post-processing once merging works
            //var f = __dirname + '/../../commonjs/kanso/templates.js';
            var f = __dirname + '/../kanso/templates.js';<commit_msg>run kanso.templates postprocessor before properties/load and kanso.core/app<commit_after>var templates = require('./templates'),
    modules = require('../../../lib/modules'),
    async = require('../../../deps/async'),
    fs = require('fs');


/**
 * Loads module directories specified in kanso.json and adds the modules
 * to the document.
 */

module.exports = {
    before: ['modules/attachment', 'properties/load', 'kanso.core/app'],
    run: function (root, path, settings, doc, callback) {

        // load the dust source code
        var dust_path = __dirname + '/../../../deps/dustjs/lib/dust.js';
        fs.readFile(dust_path, function (err, dust_src) {
            if (err) {
                return callback(err);
            }

            var template_str = '';
            for (var k in doc.templates) {
                template_str += doc.templates[k];
            }
            delete doc.templates;

            // load the templates module bootstrap code
            // TODO move this to post-processing once merging works
            //var f = __dirname + '/../../commonjs/kanso/templates.js';
            var f = __dirname + '/../kanso/templates.js';
{'fraction_non_alphanumeric': 0.14832962138084632, 'fraction_numerical': 0.0, 'mean_word_length': 1.8575063613231553, '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': '6337682', 'n_tokens_mistral': 624, 'n_tokens_neox': 595, 'n_words': 171}