docs: function generateCardDocument(options, callback) {
    var DB = require('../index').db,
      elementId = Cuid();
  
    // defaults
    options = _.defaultsDeep(options, {
      directory: '.',
      css: true,
      js: false,
      clientStateSupport: false,
      clientProxySupport: false,
      clientAnalyticsSupport: false,
      viewModel: {
        link: options.link,
        card: {
          id: elementId,
          name: options.cardName,
          pack: options.packName
        }
      },
      clientLocals: {
        title: options.title,
        card: {
          id: elementId,
          key: options.key,
          name: options.cardName,
          pack: options.packName,
          url: options.url
        }
      }
    });
      
    Async.waterfall([
        function (cb) {
          stylesToString(options, function (css) {
            cb(null, css);
          });
        },
  
        function (css, cb) {
          if (options.clientStateSupport || options.clientAnalyticsSupport || options.clientProxySupport) {
            // generate a one-time #Do API key.
            DB.issueAPIKey(options.key, function (err, apiKey) {
              if (apiKey) {
                options.clientLocals.card.apiKey = apiKey;
              }
  
              cb(null, css);
            });
          }
          else {
            cb(null, css);
          }
        },
  
        function (css, cb) {
          jsToString(options, function (js) {
            cb(null, css, js);
          });
        },
  
        function (css, js, cb) {
          viewToString(css, js, options, function (html) {
            cb(null, html || '');
          });
        }
      ],
  
      // done
      function (err, html) {
        callback && callback(Minify(html, {
          collapseWhitespace: true,
          removeComments: true,
          removeCommentsFromCDATA: true,
          removeAttributeQuotes: true,
          removeRedundantAttributes: true,
          removeEmptyAttributes: true,
          minifyJS: process.env.NODE_ENV === 'production',
          minifyCSS: process.env.NODE_ENV === 'production'
        }));
      }
    );
  }