<commit_before>/*
 * lesscss.org
 * https://github.com/less/less-docs
 * Copyright (c) 2013
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function(grunt) {


  // Project configuration.
  grunt.initConfig({

    // Project metadata
    pkg : grunt.file.readJSON('package.json'),
    site: grunt.file.readYAML('_config.yml'),


    config: {
      src: 'src',
      dist: '<%= site.dest %>'
    },


    /**
     * Lint JavaScript
     */
    jshint: {
      options: {jshintrc: '.jshintrc'},
      all: [
        'Gruntfile.js',
        'templates/helpers/*.js'
      ]
    },


    /**
     * Generate HTML
     */
    assemble: {
      options: {
        // Project metadata
        site: '<%= site %>',

        // Assemble extensions
        // We should use premalinks before going live
        // plugins: ['permalinks'],
        helpers: ['templates/helpers/*.js'],

        // Templates and data
        layouts: 'templates/layouts',
        partials: ['templates/includes/*.hbs'],
        data: ['data/*.{json,yml}'],

        // Dest config
        assets: '<%= site.dest %>/assets',
        flatten: true
      },
      pages: {
        // options: {
        //   permalinks: {preset: 'pretty'}
        // },
        src: 'templates/*.hbs',
        dest: '<%= site.dest %>/'
      }
    },


    /**
     * Compile LESS to CSS
     */
    less: {
      options: {
        paths: ['theme/bootstrap', 'theme/components']
      },
      docs: {
        src: ['theme/theme.less'],
        dest: '<%= assemble.options.assets %>/css/docs.css'
      }
    },


    /**
     * Before generating any new files clear out
     * any previously-created files.
     */
    clean: {
      example: ['<%= site.dest %>/*.html']
    }
  });

  // Load npm plugins to provide necessary tasks.
  grunt.loadNpmTasks('assemble');
  grunt.loadNpmTasks('assemble-less');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-jshint');

  // Default tasks to be run.
  grunt.registerTask('default', ['clean', 'jshint', 'less', 'assemble']);
};<commit_msg>some improvements in the Gruntfile<commit_after>/*
 * lesscss.org
 * https://github.com/less/less-docs
 * Copyright (c) 2013
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function(grunt) {


  // Project configuration.
  grunt.initConfig({

    // Project metadata
    pkg : grunt.file.readJSON('package.json'),
    site: grunt.file.readYAML('_config.yml'),


    jshint: {
      options: {jshintrc: '.jshintrc'},
      all: [
        'Gruntfile.js',
        'templates/helpers/*.js'
      ]
    },


    // Build HTML from templates and data
    assemble: {
      options: {
        flatten: true,
        production: false,
        assets: '<%= site.assets %>',

        // Metadata
        pkg: '<%= pkg %>',
        site: '<%= site %>',
        data: ['<%= site.data %>/*.{json,yml}'],

        // Extensions
        helpers: ['<%= site.helpers %>/*.js'],
        plugins: ['<%= site.plugins %>'],

        // Templates
        partials: '<%= site.includes %>/*.hbs',
        layoutdir: '<%= site.layouts %>',
        layout: '<%= site.layout %>',
      },
      site: {
        // options: {
        //   permalinks: {preset: 'pretty'}
        // },
        src: '<%= site.pages %>/*.hbs',
        dest: '<%= site.dest %>/'
      }
    },


    // Compile LESS to CSS
    less: {
      options: {
        paths: ['theme/bootstrap', 'theme/components']
      },
      docs: {
        src: ['theme/site.less'],
        dest: '<%= assemble.options.assets %>/css/site.css'
      }
    },


    copy: {
      assets: {
        src: ['assets/**'],
        dest: '<%= site.dest %>/'
      }
    },


    // Before generating any new files clear out any previously
    // created files.
    clean: {
      example: ['<%= site.dest %>/*.html']
    },


    // Pull down a JSON list of LESS's repos from GitHub's API,
    // so the metadata can be used in templates
    repos: {
      namespaced: {
        options: {username: 'less'},
        files: {
          '<%= site.data %>/less.json': ['repos?page=1&per_page=100']
        }
      }
    }
  });

  // Load npm plugins to provide necessary tasks.
  grunt.loadNpmTasks('assemble');
  grunt.loadNpmTasks('assemble-less');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-repos');

  // Pull down the
  grunt.registerTask('update', ['repos', 'default']);

  // Default tasks to be run.
  grunt.registerTask('default', ['clean', 'copy', 'jshint', 'less', 'assemble']);
};
{'fraction_non_alphanumeric': 0.18091963902019767, 'fraction_numerical': 0.002578427159432746, 'mean_word_length': 1.9536802030456852, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 24, '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': '2037368', 'n_tokens_mistral': 1586, 'n_tokens_neox': 1485, 'n_words': 309}