<commit_before>/**!
 * make.js, script to build the website for MPC-HC
 * Released under the terms of MIT license
 *
 * https://github.com/mpc-hc/website
 *
 * Copyright (C) 2013 MPC-HC Team
 */

/* jshint forin:true, noarg:true, noempty:true, eqeqeq:true, bitwise:true,
   camelcase:true, trailing:true, strict:true, boss:true, unused:true,
   curly:true, indent:4, maxerr:100 */
/*global cd, cp, target, echo, cat, exec, pushd, popd, rm, require, __dirname */

(function () {
    'use strict';

    require('shelljs/make');
    var fs = require('fs');
    var cleanCSS = require('clean-css');
    var UglifyJS = require('uglify-js');

    var ROOT_DIR = __dirname + '/',         // absolute path to project's root
        BUILD_DIR = ROOT_DIR + 'build/',
        BUILD_TARGET = BUILD_DIR + 'website/',
        SRC_DIR = ROOT_DIR + 'source/',
        SPHINXOPTS = '-d' + ' ' + BUILD_DIR + '/doctrees' + ' ' + SRC_DIR + ' ' + BUILD_TARGET;


    //
    // make website
    //
    target.website = function () {
        cd(ROOT_DIR);
        echo();
        echo("### Building posts...");
        exec('python -u sphinxblog/gen.py');

        echo();
        echo("### Building site...");
        exec('sphinx-build -b dirhtml' + ' ' + SPHINXOPTS);


        echo();
        echo("### Removing files we don't need...");

        pushd(BUILD_TARGET);

        var filesToRemoveFromDist = [
            '.buildinfo',
            '_static/*.css',
            '_static/*.gif',
            '_static/*.js',
            '_static/*.png',
            '_static/css/*.css',
            '_static/favicon.ico',
            '_static/js/*.js',
            'genindex',
            'objects.inv',
            'search',
            'searchindex.js'];

        rm('-rf', filesToRemoveFromDist);

        popd();


        echo();
        echo("### Copying files...");

        pushd(SRC_DIR);

        var filesToCopyToDist = [
            'robots.txt',
            'version.txt',
            '_static/apple-touch-icon*.png',
            '_static/favicon.ico'];

        cp('-f', filesToCopyToDist, BUILD_TARGET);
        cp('-f', '_static/js/html5shiv.js', BUILD_TARGET + '_static/js');
        cp('-f', '_static/js/jquery-*.min.js', BUILD_TARGET + '_static/js');

        echo();
        echo("### Combining css files...");

        var inCss = cat(['_static/css/normalize.css',
                         '_static/css/bootstrap.css',
                         '_static/css/jquery.fancybox.css',
                         '_static/css/jquery.fancybox-thumbs.css',
                         '_static/css/style.css']);

        var outCss = BUILD_TARGET + '_static/css/pack.css';
        var minifiedCss = cleanCSS.process(inCss, {
                            removeEmpty: true,
                            keepSpecialComments: 0});

        fs.writeFileSync(outCss, minifiedCss, 'utf8');

        echo();
        echo("### Combining js files...");

        var inJs = cat(['_static/js/plugins.js',
                        '_static/js/bootstrap.js',
                        '_static/js/jquery.mousewheel.js',
                        '_static/js/jquery.fancybox.js',
                        '_static/js/jquery.fancybox-thumbs.js']);

        var outJs = BUILD_TARGET + '_static/js/pack.js';
        var minifiedJs = UglifyJS.minify(inJs, {
                            compress: true,
                            fromString: true, // this is needed to pass JS source code instead of filenames
                            mangle: true,
                            warnings: false});

        fs.writeFileSync(outJs, minifiedJs.code, 'utf8');
<commit_msg>make.js: reindent<commit_after>/**!
 * make.js, script to build the website for MPC-HC
 * Released under the terms of MIT license
 *
 * https://github.com/mpc-hc/website
 *
 * Copyright (C) 2013 MPC-HC Team
 */

/* jshint forin:true, noarg:true, noempty:true, eqeqeq:true, bitwise:true,
   camelcase:true, trailing:true, strict:true, boss:true, unused:true,
   curly:true, indent:4, maxerr:100 */
/*global cd, cp, target, echo, cat, exec, pushd, popd, rm, require, __dirname */

(function () {
    'use strict';

    require('shelljs/make');
    var fs = require('fs');
    var cleanCSS = require('clean-css');
    var UglifyJS = require('uglify-js');

    var ROOT_DIR = __dirname + '/',         // absolute path to project's root
        BUILD_DIR = ROOT_DIR + 'build/',
        BUILD_TARGET = BUILD_DIR + 'website/',
        SRC_DIR = ROOT_DIR + 'source/',
        SPHINXOPTS = '-d' + ' ' + BUILD_DIR + 'doctrees/' + ' ' + SRC_DIR + ' ' + BUILD_TARGET;


    //
    // make website
    //
    target.website = function () {
        cd(ROOT_DIR);
        echo();
        echo("### Building posts...");
        exec('python -u sphinxblog/gen.py');

        echo();
        echo("### Building site...");
        exec('sphinx-build -b dirhtml' + ' ' + SPHINXOPTS);


        echo();
        echo("### Removing files we don't need...");

        pushd(BUILD_TARGET);

        var filesToRemoveFromDist = [
            '.buildinfo',
            '_static/*.css',
            '_static/*.gif',
            '_static/*.js',
            '_static/*.png',
            '_static/css/*.css',
            '_static/favicon.ico',
            '_static/js/*.js',
            'genindex',
            'objects.inv',
            'search',
            'searchindex.js'
        ];

        rm('-rf', filesToRemoveFromDist);

        popd();


        echo();
        echo("### Copying files...");

        pushd(SRC_DIR);

        var filesToCopyToDist = [
            'robots.txt',
            'version.txt',
            '_static/apple-touch-icon*.png',
            '_static/favicon.ico'
        ];

        cp('-f', filesToCopyToDist, BUILD_TARGET);
        cp('-f', '_static/js/html5shiv.js', BUILD_TARGET + '_static/js');
        cp('-f', '_static/js/jquery-*.min.js', BUILD_TARGET + '_static/js');

        echo();
        echo("### Combining css files...");

        var inCss = cat(['_static/css/normalize.css',
                         '_static/css/bootstrap.css',
                         '_static/css/jquery.fancybox.css',
                         '_static/css/jquery.fancybox-thumbs.css',
                         '_static/css/style.css'
        ]);

        var outCss = BUILD_TARGET + '_static/css/pack.css';
        var minifiedCss = cleanCSS.process(inCss, {
            removeEmpty: true,
            keepSpecialComments: 0
        });

        fs.writeFileSync(outCss, minifiedCss, 'utf8');

        echo();
        echo("### Combining js files...");

        var inJs = cat(['_static/js/plugins.js',
                        '_static/js/bootstrap.js',
                        '_static/js/jquery.mousewheel.js',
                        '_static/js/jquery.fancybox.js',
                        '_static/js/jquery.fancybox-thumbs.js']);

        var outJs = BUILD_TARGET + '_static/js/pack.js';
        var minifiedJs = UglifyJS.minify(inJs, {
            compress: true,
            fromString: true, // this is needed to pass JS source code instead of filenames
            mangle: true,
            warnings: false
        });

        fs.writeFileSync(outJs, minifiedJs.code, 'utf8');

{'fraction_non_alphanumeric': 0.15489243580846634, 'fraction_numerical': 0.0033310201249132547, 'mean_word_length': 1.6928251121076232, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '1603021', 'n_tokens_mistral': 2287, 'n_tokens_neox': 2184, 'n_words': 437}