// kouto-swiss gruntfile

"use strict";

module.exports = function( grunt ) {

    require( "load-grunt-tasks" )( grunt );

    grunt.initConfig( {
        "mochacli": {
            "options": {
                "require": [ "should" ],
                "reporter": "spec",
                "inline-diffs": true,
            },
            "tests": {
                "src": "test/runner.js",
            },
        },
        "clean": {
            "docs": [ "docs/**" ],
        },
        "stylus": {
            "options": {
                "compress": true,
                "use": [ require( "./lib/kouto-swiss.js" ) ],
            },
            "docs": {
                "files": {
                    "docs/styles/styles.css": "_docs/_styles/styles.styl",
                },
            },
        },
        "pug": {
            "options": {
                "compress": true,
            },
            "website": {
                "options": {
                    "data": {
                        "pkg": grunt.file.readJSON( "package.json" ),
                        "index": grunt.file.readJSON( "src/docs/index.json" ),
                        "utils": require( __dirname + "/src/js/utils.js" ),
                    },
                },
                "files": {
                    "docs/index.html": "src/pug/index.pug",
                },
            },
        },
        "copy": {
            "cname": {
                "src": "src/CNAME",
                "dest": "docs/CNAME",
            },
        },
        "connect": {
            "docs": {
                "options": {
                    "port": 5555,
                    "hostname": "*",
                    "base": "./docs",
                    "keepalive": true,
                    "livereload": true,
                },
            },
        },
        "concurrent": {
            "docs": {
                "tasks": [ "connect:docs", "watch" ],
                "options": {
                    "logConcurrentOutput": true,
                },
            },
        },
        "watch": {
            "options": {
                "livereload": true,
            },
            "pug": {
                "files": "src/pug/**/*.pug",
                "tasks": [ "pug" ],
            },
            "styles": {
                "files": "_docs/_styles/**/*.styl",
                "tasks": [ "stylus" ],
            },
            "scripts": {
                "files": "_docs/_js/**/*.js",
                "tasks": [ "copy:scripts" ],
            },
            "docs": {
                "files": "_docs/**/*.md",
                "tasks": [ "jade" ],
            },
        },
    } );

    grunt.registerTask( "default", [
        "clean",
        "pug",
        // "stylus",
        "copy",
    ] );

    grunt.registerTask( "test", [
        "mochacli",
    ] );

    grunt.registerTask( "preview", [
        "default",
        "connect:docs",
    ] );

    grunt.registerTask( "work", [
        "default",
        "concurrent",
    ] );

    grunt.registerTask( "build", [
        "default",
    ] );
};

@@ -704,21 +704,25 @@
   %22docs/
-style
+assets/cs
 s/styles
@@ -729,28 +729,25 @@
 .css%22: %22
-_docs/_
+src/
 styl
-e
+u
 s/styles
@@ -2308,20 +2308,17 @@
 %22: %22
-_docs/_
+src/
 styl
-e
+u
 s/**
@@ -2385,139 +2385,8 @@
  %7D,%0A
-            %22scripts%22: %7B%0A                %22files%22: %22_docs/_js/**/*.js%22,%0A                %22tasks%22: %5B %22copy:scripts%22 %5D,%0A            %7D,%0A
     
@@ -2477,12 +2477,11 @@
  %5B %22
-jade
+pug
 %22 %5D,

Fix path in tasks