docs: function buildJSON(file) {
      var doc   = {
          main: []
        },
        jsf   = file,
        cssf  = file.replace(/js/g, "less"),
        usef  = file.replace('src/js', "src/docs").replace('src/less', "src/docs").replace(/js/g, "md").replace(/less/g, "md"),
        demof = file.replace('src/js', "src/docs").replace('src/less', "src/docs").replace(/js/g, "html").replace(/less/g, "html"),
        jsFile   = fs.exists( jsf )   ? fs.read( jsf )  : false,
        cssFile  = fs.exists( cssf )  ? fs.read( cssf ) : false,
        useFile  = fs.exists( usef )  ? fs.read( usef ) : false,
        demoFile = fs.exists( demof ) ? fs.read( demof ) : false,
        destination;
  
      if (cssFile) {
        destination = file.replace('src/less', "docs/json").replace('.less', ".json");
      }
      if (jsFile && cssf !== file) {
        destination = file.replace('src/js', "docs/json").replace('.js', ".json");
      }
  
      // JS
      if (jsFile) {
        var jsMatches = jsFile.match(/(?:\/\*(?:[^*]|(?:\*+[^*\/]))*\*+\/)/g)
  
        doc.options = [];
        doc.events = [];
        doc.methods = [];
  
        if (jsMatches) {
          for (var i = 0, count = jsMatches.length; i < count; i++) {
            var content = jsMatches[i];
  
            if (content.indexOf("@plugin") > -1) {
              var plugin = parseJavascript(content);
              doc.name = plugin.name;
              doc.namespace = plugin.namespace;
              doc.type = plugin.type;
              doc.description = plugin.description;
              doc.main = plugin.main;
              doc.dependencies = plugin.dependencies;
            } else if (content.indexOf("@options") > -1) {
              var params = parseJavascript(content);
              doc.options = params["params"];
            } else if (content.indexOf("@events") > -1) {
              var events = parseJavascript(content);
              doc.events = events["events"];
            } else if (content.indexOf("@method") > -1) {
  
  
              if (!doc.methods) {
                doc.methods = [];
              }
  
              var m = parseJavascript(content);
  
              if (content.indexOf("private") < 0) {
                if (content.indexOf("@method widget") > -1) {
                  widgetMethods.push(m);
                } else if (content.indexOf("@method utility") > -1) {
                  utilityMethods.push(m);
                } else {
                  doc.methods.push(m);
                }
              }
            }
          }
        }
      }
  
      if (cssFile) {
  
        var cssMatches = cssFile.match(/(?:\/\*(?:[^*]|(?:\*+[^*\/]))*\*+\/)/g);
        doc.css = [];
  
        if (cssMatches) {
          // CSS
          for (var i = 0, count = cssMatches.length; i < count; i++) {
            var content = cssMatches[i];
  
            if (content.indexOf("@class") > -1) {
              var klass = parseCSS(content);
              if (klass.name) {
                doc.css.push(klass);
              }
            } else if (content.indexOf("@grid") > -1) {
              if (content.indexOf("@ignore") < 0) {
                var grid = parseCSS(content);
                doc.name = grid.name;
                doc.namespace = grid.namespace;
                doc.type = "grid";
                doc.description = grid.description;
              }
            }
          }
        }
      }
  
      if (doc.name) {
        var namespace = doc.name.toLowerCase().replace(/ /g, "");
  
        if (jsFile) {
          if (namespace !== "formstone" && namespace !== "core" && namespace !== "grid") {
            if (doc.type === "widget") {
              for (var i in widgetMethods) {
                var m = JSON.parse(JSON.stringify(widgetMethods[i]));
  
                if (m.examples) {
                  for (var j in m.examples) {
                    m.examples[j] = m.examples[j].replace('{ns}', namespace);
                  }
                }
  
                doc.methods.push(m);
              }
            }
  
            for (var i in utilityMethods) {
              var m = JSON.parse(JSON.stringify(utilityMethods[i]));
  
              if (m.examples) {
                for (var j in m.examples) {
                  m.examples[j] = m.examples[j].replace('{ns}', namespace);
                }
              }
  
              doc.methods.push(m);
            }
          }
  
          doc.methods.sort(function(a, b) {
            if (a.name < b.name) return -1;
              if (a.name > b.name) return 1;
              return 0;
          });
        }
  
        if (useFile) {
          doc.use = useFile;
        }
        if (demoFile) {
          doc.demo = demoFile;
        }
  
        doc.document = buildMarkdown(doc);
  
        fs.write(destination, JSON.stringify(doc));
  
        if (allDocs[doc.type]) {
          allDocs[doc.type].push(doc);
        }
      }
    }