var url = require('url')
  , path = require('path')

module.exports = function(ext, index) {
  ext = ext || '.html';
  index = index || 'index'
  
  return function prettyURL(page, next) {
    var dirname = path.dirname(page.path)
      , basename = path.basename(page.path, ext);
    if (index !== basename) {
      var pp = path.join(dirname, basename, index + ext);
      page.path = pp;
    }
    next();
  }
}

@@ -1,56 +1,882 @@
-var url = require('url')%0A  , path = require('path')%0A
+/**%0A * Module dependencies.%0A */%0Avar path = require('path')%0A%0A%0A/**%0A * Pretty URL middleware.%0A *%0A * This middleware transforms page paths into pretty URLs.  A pretty URL is one%0A * which does not indicate a file extension, instead allowing for content%0A * negotiation via MIME types.%0A *%0A * While content negotiation is not applicable to static sites, pretty URLs%0A * still have benefits to user experience and search engine optimization.%0A *%0A * Any path that ends in _name.html_ will be rewritten to _name/index.html_.%0A * With the web server configured correctly, the index file will be served by%0A * default, and URLs can take the form:%0A *%0A *     http://www.example.com/name%0A *%0A * Instead of:%0A *%0A *     http://www.example.com/name.html%0A *%0A * Examples:%0A *%0A *     site.use(kerouac.prettyURLs());%0A *%0A * @param %7BString%7D ext%0A * @param %7BString%7D index%0A * @return %7BFunction%7D%0A * @api public%0A */
 %0Amod

Add examples to prettyURL documentation.