{"_id":"kepler","_rev":"31-3e597c1caa5e6ff764d895e60363c352","name":"kepler","dist-tags":{"latest":"1.0.0"},"versions":{"0.0.1":{"name":"kepler","version":"0.0.1","dependencies":{"connect":"1.7.1","ejs":"0.4.3","props":"0.1.0","marked":"0.1.0","commander":"0.2.0","stylus":"0.19.0"},"author":{"name":"Derek Worthen"},"bin":{"kepler":"bin/kepler.js"},"engines":{"node":"0.4.11"},"_npmUser":{"name":"dworthen","email":"worthend.derek@gmail.com"},"_id":"kepler@0.0.1","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.103","_nodeVersion":"v0.4.11","_defaultsLoaded":true,"dist":{"shasum":"ceba8373478189ed64b68a2c182bd6ff12fbe9a0","tarball":"https://registry.npmjs.org/kepler/-/kepler-0.0.1.tgz","integrity":"sha512-tPUdRxePUk75MuW+dBrbDmo4/5Q1xrsBcCqNvxwqSgEhQh41dqqnCHagswOdZfs1P0jc0F0i6aItF3CY/CwQ2w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHKiVntVX50gwYOCydvGdj+FaUzjrDwf38mb2zzVzBxfAiEAgjSeFclJBiNs6riDA5AnFEPiuM9LDbvyRp3+wQDA7EU="}]},"maintainers":[{"name":"dworthen","email":"worthend.derek@gmail.com"}],"directories":{}},"0.0.11":{"name":"kepler","version":"0.0.11","dependencies":{"connect":"1.7.1","ejs":"0.4.3","props":"0.1.0","marked":"0.1.0","commander":"0.2.0","stylus":"0.19.0"},"author":{"name":"Derek Worthen"},"bin":{"kepler":"bin/kepler.js"},"engines":{"node":"0.4.11"},"_npmUser":{"name":"dworthen","email":"worthend.derek@gmail.com"},"_id":"kepler@0.0.11","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.103","_nodeVersion":"v0.4.11","_defaultsLoaded":true,"dist":{"shasum":"ddb96638f89de71367f4025f2886dec7cff41346","tarball":"https://registry.npmjs.org/kepler/-/kepler-0.0.11.tgz","integrity":"sha512-fhRfzk6FOImx/Xh/0DlRtvjbbNjHIc6MxhIUzihkbsaRxt4+V+bu/B2jFRW4lwX0seF0NOVeVUrHPkviVtXF/Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2cJ2snWWKWo3MJSz7ljJDhwbbutfcUoRExtz3ACBp3gIhALQvORcbMue3BaBPMsj5YgyuJ6tOUXGs5qxGfew26eOS"}]},"maintainers":[{"name":"dworthen","email":"worthend.derek@gmail.com"}],"directories":{}},"0.1.0":{"name":"kepler","version":"0.1.0","description":"Static website generator","dependencies":{"connect":"1.7.3","ejs":"0.4.3","props":"0.1.0","marked":"0.1.2","commander":"0.3.2","stylus":"0.19.2","nib":"0.2.0"},"author":{"name":"Derek Worthen"},"bin":{"kepler":"bin/kepler.js"},"engines":{"node":"0.4.11"},"_npmUser":{"name":"dworthen","email":"worthend.derek@gmail.com"},"_id":"kepler@0.1.0","devDependencies":{},"_engineSupported":false,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"4cc2046bb851228540c6ba9f1db3e7dcbafbbbb2","tarball":"https://registry.npmjs.org/kepler/-/kepler-0.1.0.tgz","integrity":"sha512-kS+3+mIaEhpFIcLu7FBsbqGvFaP6dg8pCm9unSEojiPEKSSq0NSVw1hnV8LkPNBk+XGN19GjN2CfYngybQdRlA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBs7zpRCqM7XCAzuFpXgRlYf9qamcsiQC8pbsuGSSlUUAiBmrT0eEPYvb4ZL5q1B8Cu+Y4+M8GopENqw2Si8qBcAqA=="}]},"maintainers":[{"name":"dworthen","email":"worthend.derek@gmail.com"}],"directories":{}},"0.2.0":{"name":"kepler","version":"0.2.0","description":"Static website generator","author":{"name":"Derek Worthen"},"dependencies":{"markdown":"~0.5.0"},"readme":"# Kepler v0.2.0\n\nVersion 0.2.0 is a complete overhaul from previous versions. Previous versions were poor attempts to be a Jekyll clone. Without a clear vision or problem to solve Kepler v0.1.x was convoluted solution for producing static websites. \n\nVersion 0.2.0 points Kepler into a new direction. Kepler is no longer a tool for building static websites but is now aiming to be a simple blog generator. \n\n## Install\n\n```shell\nnpm install kepler\n```\n\n## Usage\n\n```javascript\nvar http = require('http')\n  , kepler = require('../index')\n  , connect = require('connect')\n  , app = connect();\n\napp.use(kepler('articles'));\n\nhttp.createServer(app).listen(3000);\n```\n","readmeFilename":"readme.md","_id":"kepler@0.2.0","dist":{"shasum":"a84176a5441635d96488dc11477c253b70607d8e","tarball":"https://registry.npmjs.org/kepler/-/kepler-0.2.0.tgz","integrity":"sha512-3Six3s8KYWXJ1dPOpmRbnY1ZFMU2LkcsfsXDcVfz1o+fEU/HP/gd6TAxM/M8PkL8h1oAQy2+pWs1C39CRepiOA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCV7RtLSUhyZbmQu5mO3H9couYzg5BRxqRBYH3XcPS2fgIhAPyNEvEpgBi3qYB6lvQL8yNsvOxQOH1kvNquOu3etlmU"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"dworthen","email":"worthend.derek@gmail.com"},"maintainers":[{"name":"dworthen","email":"worthend.derek@gmail.com"}],"directories":{}},"0.2.1":{"name":"kepler","version":"0.2.1","description":"Static website generator","author":{"name":"Derek Worthen"},"dependencies":{"markdown":"~0.5.0","yaml-front-matter":"~2.1.0"},"devDependencies":{"connect":"~2.9.0","consolidate":"~0.9.1","ejs":"~0.8.4"},"repository":{"type":"git","url":"dworthen/node-kepler"},"readme":"# Kepler v0.2.x\n\n#### Kepler is still very much in alpha phase and is not ready for production.\n\nVersion 0.2.x is a complete overhaul from previous versions. Previous versions were poor attempts to be a Jekyll clone. Without a clear vision or problem to solve Kepler v0.1.x was convoluted solution for producing static websites. \n\nVersion 0.2.x points Kepler into a new direction. Kepler is no longer a tool for building static websites but is now aiming to be a simple blog generator. Kepler is a connect middleware that will serve up markdown (.md) files.\n\n## Install\n\n```shell\nnpm install kepler\n```\n\n## Usage\n\nKepler will parse the requested file using [js-yaml-front-matter](https://github.com/dworthen/js-yaml-front-matter) and add the object to req. the __content property on req.kepler will be parsed using [markdown-js](https://github.com/evilstreak/markdown-js).\n\n```javascript\nvar http = require('http')\n  , kepler = require('kepler')\n  , connect = require('connect')\n  , app = connect();\n\napp.use(kepler('articles'));\napp.use(function(req, res, next) {\n  if(req.kepler) return res.end(kepler.__content));\n  return next();\n});\n\nhttp.createServer(app).listen(3000);\n```\n\n### Using a template\n\nThis example uses [consolidate](https://github.com/visionmedia/consolidate.js) and the [ejs](https://github.com/visionmedia/ejs/wiki) template engine to render markdown files within a layout.\n\n```javascript\nvar http = require('http')\n  , kepler = require('kepler')\n  , cons = require('consolidate')\n  , connect = require('connect')\n  , app = connect();\n\napp.use(kepler('articles'));\n// TODO: package this as a seperate middleware piece.\napp.use(function(req, res, next){\n  if(req.kepler) {\n    cons.ejs('test/layout.ejs', req.kepler, function(err, html) {\n      if (err) throw err; \n      res.end(html);\n    });\n  } else {\n    return next();\n  }\n});\n```\n\nlayout.ejs\n\n```html\n<h1><%= title %></h1>\n<%- __content %>\n<p><%= intro %></p>\n<ul>\n  <% list.forEach(function(item) { %>\n    <li><%= item %></li>\n  <% }); %>\n</ul>\n```\n\ntest.md file within articles/ to render\n\n```yaml\n---\ntitle: \"Test Site\"\nintro: \"Intro Paragraph\"\nlist:\n  - one\n  - two\n---\nTHIS IS A TEST\n==============\n```\n\nWill produce:\n\n```html\n<h1>Test Site</h1>\n<h1>THIS IS A TEST</h1>\n<p>Intro Paragraph</p>\n<ul>\n  \n    <li>one</li>\n  \n    <li>two</li>\n  \n</ul>\n```\n\n## Changelog\n\nVersion 0.2.1 no longer renders markdown files directly but instead parses the file using js-yaml-front and markdown-js and passes the resulting object through the req body. This allows for people to write connect middleware to pre/post modify the parsed file.  \n\n## TODO\n\n- Kepler will become a collection of connect middleware for modifying and parsing markdown files for displaying them as a blog.\n- Create a middleware to render the markdown using a predefined layout.\n","readmeFilename":"readme.md","_id":"kepler@0.2.1","dist":{"shasum":"5b2a3903b8a3a900a06ab6f18eeaea7c26138484","tarball":"https://registry.npmjs.org/kepler/-/kepler-0.2.1.tgz","integrity":"sha512-dlDVEjMn3TglnNCC+HVcNnTVNu0AcsMRNk1PClgoMgnobXFzskkt8QY5pY5jx5egPaBgUu21DTQXT1gJf+qtEw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDijPYVa1TTHimU6RNlkEv5Wqj/0DRjIaU1+/JJ2ryApAIhAPsuAM/DUFgtwfU6mzgigYmI7g1cb1GMqOz2OUsDW9fu"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"dworthen","email":"worthend.derek@gmail.com"},"maintainers":[{"name":"dworthen","email":"worthend.derek@gmail.com"}],"directories":{}},"0.2.2":{"name":"kepler","version":"0.2.2","description":"Static website generator","author":{"name":"Derek Worthen"},"dependencies":{"markdown":"~0.5.0","consolidate":"~0.9.1","yaml-front-matter":"~2.1.0"},"devDependencies":{"connect":"~2.9.0","ejs":"~0.8.4"},"repository":{"type":"git","url":"dworthen/node-kepler"},"readme":"# Kepler v0.2.x\n\n#### Kepler is still very much in alpha phase and is not ready for production.\n\nKepler is a collection of connect middleware designed to serve up a directory of markdown files (.md) as a blog. \n\n## Install\n\n```shell\nnpm install kepler\n```\n\n## Usage v0.2.2\n\nThe main middleware piece to kepler is the parser. Keplers parser will parse the requested file using [js-yaml-front-matter](https://github.com/dworthen/js-yaml-front-matter) and add the object to req. the __content property on req.kepler will be parsed using [markdown-js](https://github.com/evilstreak/markdown-js).\n\n```javascript\nvar http = require('http')\n  , kepler = require('kepler')\n  , connect = require('connect')\n  , app = connect();\n\napp.use(kepler.parse('articles'));\napp.use(function(req, res, next) {\n  // req.kepler.__content will have the heart of the .md file\n  if(req.kepler) return res.end(kepler.__content));\n  return next();\n});\n\nhttp.createServer(app).listen(3000);\n```\n\nIf the markdown file being rendered contains\n\n```yaml\n---\ntitle: \"Website\"\nlist:\n  - one\n  - two\n----\n# Body!\n```\n\nthen `req.kepler` will be\n\n```javascript\n{\n  title: \"website\",\n  list: [\"one\", \"two\"]\n  __content: \"<h1>Body!</h1>'\n}\n```\n\n### Using a template\n\nThis example uses the kepler render middleware which utilizes [consolidate.js](https://github.com/visionmedia/consolidate.js) for rendering predefined layout files.\n\n```javascript\nvar http = require('http')\n  , kepler = require('kepler')\n  , connect = require('connect')\n  , app = connect();\n\napp.use(kepler('articles'));\napp.use(kepler.parse({\n  engine: 'ejs',\n  layout: 'layout.ejs'\n});\n\nhttp.createServer(app).listen(3000);\nconsole.log('listening on port 3000');\n```\n\nlayout.ejs\n\n```html\n<h1><%= title %></h1>\n<%- __content %>\n<p><%= intro %></p>\n<ul>\n  <% list.forEach(function(item) { %>\n    <li><%= item %></li>\n  <% }); %>\n</ul>\n```\n\narticles/test.md\n\n```yaml\n---\ntitle: \"Test Site\"\nintro: \"Intro Paragraph\"\nlist:\n  - one\n  - two\n---\nTHIS IS A TEST\n==============\n```\n\nWill produce:\n\n```html\n<h1>Test Site</h1>\n<h1>THIS IS A TEST</h1>\n<p>Intro Paragraph</p>\n<ul>\n  \n    <li>one</li>\n  \n    <li>two</li>\n  \n</ul>\n```\n\n## Changelog\n\nVersion 0.2.1 no longer renders markdown files directly but instead parses the file using js-yaml-front and markdown-js and passes the resulting object through the req body. This allows for people to write connect middleware to pre/post modify the parsed file.  \n\nVersion 0.2.x is a complete overhaul from previous versions. Previous versions were poor attempts to be a Jekyll clone. Without a clear vision or problem to solve Kepler v0.1.x was convoluted solution for producing static websites. \n\nVersion 0.2.x points Kepler into a new direction. Kepler is no longer a tool for building static websites but is now aiming to be a simple blog generator. Kepler is a connect middleware that will serve up markdown (.md) files.\n\n## TODO\n\n- Kepler will become a collection of connect middleware for modifying and parsing markdown files for displaying them as a blog.\n- Create a middleware to render the markdown using a predefined layout.\n","readmeFilename":"readme.md","_id":"kepler@0.2.2","dist":{"shasum":"6662a757da12c3b606a7c7a92c790ce3d47ef989","tarball":"https://registry.npmjs.org/kepler/-/kepler-0.2.2.tgz","integrity":"sha512-u8wNQzVO96+UYfLl7Sy7RbOL6jbwSabIY5Pi8/7pFToK4AmgMVf+1ookSvMyogBIGEPgpPIxbd2CloWGnAMBqQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC6Gj0UgD0DQ+rhj5cFVSycSVH8npklKo3eX2junA10ewIhALp+X6t8fJ1FtbkMUtSy7SxlPFA+azBZUNi48xvEc6kF"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"dworthen","email":"worthend.derek@gmail.com"},"maintainers":[{"name":"dworthen","email":"worthend.derek@gmail.com"}],"directories":{}},"0.2.3":{"name":"kepler","version":"0.2.3","description":"Static website generator","author":{"name":"Derek Worthen"},"dependencies":{"markdown":"~0.5.0","consolidate":"~0.9.1","yaml-front-matter":"~2.1.0"},"devDependencies":{"connect":"~2.9.0","ejs":"~0.8.4","express":"~3.4.0"},"repository":{"type":"git","url":"dworthen/node-kepler"},"readme":"# Kepler v0.2.x\n\n#### Kepler is under heavy development, the API is subject to change.\n\nKepler is a collection of connect middleware designed to serve up a directory of markdown files (.md) as a blog. \n\n## Install\n\n```shell\nnpm install kepler\n```\n\n## Usage - v0.2.3\n\nThe main middleware piece to kepler is the parser. Keplers parser will parse the requested file using [js-yaml-front-matter](https://github.com/dworthen/js-yaml-front-matter) and add the object to req. the __content property on req.kepler will be parsed using [markdown-js](https://github.com/evilstreak/markdown-js).\n\n```javascript\nvar http = require('http')\n  , kepler = require('kepler')\n  , connect = require('connect')\n  , app = connect();\n\napp.use(kepler.parse('articles'));\napp.use(function(req, res, next) {\n  // req.kepler.__content will have the heart of the .md file\n  if(req.kepler) return res.end(kepler.__content));\n  return next();\n});\n\nhttp.createServer(app).listen(3000);\n```\n\nIf the markdown file being rendered contains\n\n```yaml\n---\ntitle: \"Website\"\nlist:\n  - one\n  - two\n----\n# Body!\n```\n\nthen `req.kepler` will be\n\n```javascript\n{\n  title: \"website\",\n  list: [\"one\", \"two\"]\n  __content: \"<h1>Body!</h1>'\n}\n```\n\n### Using a template\n\nThis example uses the kepler render middleware which utilizes [consolidate.js](https://github.com/visionmedia/consolidate.js) for rendering predefined layout files.\n\n```javascript\nvar http = require('http')\n  , kepler = require('kepler')\n  , connect = require('connect')\n  , app = connect();\n\napp.use(kepler('articles'));\napp.use(kepler.parse({\n  engine: 'ejs',\n  layout: 'layout.ejs'\n});\n\nhttp.createServer(app).listen(3000);\nconsole.log('listening on port 3000');\n```\n\nlayout.ejs\n\n```html\n<h1><%= title %></h1>\n<%- __content %>\n<p><%= intro %></p>\n<ul>\n  <% list.forEach(function(item) { %>\n    <li><%= item %></li>\n  <% }); %>\n</ul>\n```\n\narticles/test.md\n\n```yaml\n---\ntitle: \"Test Site\"\nintro: \"Intro Paragraph\"\nlist:\n  - one\n  - two\n---\nTHIS IS A TEST\n==============\n```\n\nWill produce:\n\n```html\n<h1>Test Site</h1>\n<h1>THIS IS A TEST</h1>\n<p>Intro Paragraph</p>\n<ul>\n  \n    <li>one</li>\n  \n    <li>two</li>\n  \n</ul>\n```\n\n### Displaying a list of blog entries\n\nThis example uses a piece of middleware for displaying a directory of markdown files as list of blog entries. The example uses [express](http://expressjs.com/).\n\n```javascript\nvar http = require('http')\n  , kepler = require('kepler')\n  , express = require('express')\n  , cons = require('consolidate')\n  , app = express();\n\napp.use(express.static('test/'));\n\n// Single file parsing and rendering\napp.use(kepler.parse('test/fixtures'));\n\napp.use(kepler.render({\n  engine: 'ejs',\n  layout: 'test/layout.ejs'\n}));\n\n// Directory rendering\napp.use(kepler.dirParse({\n  location: 'test/fixtures'\n}));\n\n//TODO: Create a piece of middleware to render the list of files.\napp.use(function(req, res, next) {\n  if (req.kepler) {\n    cons.ejs(\"test/blogLayout.ejs\", {files: req.kepler}, function(err, html) {\n      if (err) return next(err);\n      return res.end(html);\n    });\n  }\n});\n\nhttp.createServer(app).listen(3000);\nconsole.log('listening on port 3000');\n```\n\nblogLayout.ejs\n\n```javascript\n<% files.forEach(function(file) { %>\n<h2><%= file.file.title %></h2>\n<p><%= file.ctime %></p>\n<% }); %>\n```\n\nThe layout expects the markdown files to at least have a title attribute.\n\n```yaml\n---\ntitle: \"Blog Title\"\n---\n### content\n```\n\nThe dirParse middleware attaches a list of files in a directory to the req body under the kepler property. The files are ordered based on when the were last edited, the most recently edited file being first.\n\nEach object in the list has access to the file [stats](http://nodejs.org/api/fs.html#fs_class_fs_stats). Here is an example of the type of object returned by dirParse.\n\n```javascript\n[\n{\"dev\":2054,\n\"mode\":33204,\n\"nlink\":1,\n\"uid\":1000,\n\"gid\":1000,\n\"rdev\":0,\n\"blksize\":4096,\n\"ino\":3021542,\n\"size\":104,\n\"blocks\":8,\n\"atime\":\"2013-09-18T22:37:58.000Z\",\n\"mtime\":\"2013-09-17T06:19:30.000Z\",\n\"ctime\":\"2013-09-17T06:19:30.000Z\",\n\"file\":\n  {\n    \"title\":\"Test Site\",\n    \"intro\":\"Intro Paragraph\",\n    \"list\":[\"one\",\"two\"],\n    \"__content\":\"<h1>THIS IS A TEST</h1>\",\n    \"location\":\"test/fixtures/2013/test.md\"\n  }\n}\n]\n```\n\n## Running the example\n\n```shell\ngit clone https://github.com/dworthen/node-kepler.git\ncd node-kepler\nnpm install --dev\nnode test/server.js\n```\n\n## Changelog\n\nVersion >= 0.2.1 no longer renders markdown files directly but instead parses the file using js-yaml-front and markdown-js and passes the resulting object through the req body. This allows for people to write connect middleware to pre/post modify the parsed file.  \n\nVersion 0.2.x is a complete overhaul from previous versions. Previous versions were poor attempts to be a Jekyll clone. Without a clear vision or problem to solve Kepler v0.1.x was convoluted solution for producing static websites. \n\nVersion 0.2.x points Kepler into a new direction. Kepler is no longer a tool for building static websites but is now aiming to be a simple blog generator. Kepler is a connect middleware that will serve up markdown (.md) files.\n\n## TODO\n\n- Kepler will become a collection of connect middleware for modifying and parsing markdown files for displaying them as a blog.\n- Create a middleware to render the markdown using a predefined layout.\n","readmeFilename":"readme.md","_id":"kepler@0.2.3","dist":{"shasum":"d7d9263b4366ebac8104a8d05a5201729cb81336","tarball":"https://registry.npmjs.org/kepler/-/kepler-0.2.3.tgz","integrity":"sha512-F1JUjrDUTs0gYdrdOda2L8HgWMldaIHxvUq4J1Kk5fg5AU5vuALqXwma+HDRnn/cpSjEyhrRBlqBfO488g96tg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCyXwmF8lARn2IUWgK+KqJFhjxsh1tXnPv3V7ivz+b63QIgF03zCbFgaWciNZXulT/I28139ljpHm2mN4m2p3rOdpU="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"dworthen","email":"worthend.derek@gmail.com"},"maintainers":[{"name":"dworthen","email":"worthend.derek@gmail.com"}],"directories":{}},"0.2.4":{"name":"kepler","version":"0.2.4","description":"Static website generator","author":{"name":"Derek Worthen"},"dependencies":{"markdown":"~0.5.0","consolidate":"~0.9.1","yaml-front-matter":"~2.1.0"},"devDependencies":{"connect":"~2.9.0","ejs":"~0.8.4","express":"~3.4.0","handlebars":"~1.1.1"},"repository":{"type":"git","url":"dworthen/node-kepler"},"readme":"# Kepler v0.2.x\n\n#### Kepler is under heavy development and the API is subject to change.\n\nKepler is a collection of connect middleware designed to serve up a directory of markdown files (.md) as a blog. \n\n## Install\n\n```shell\nnpm install kepler\n```\n\n## An Example\n\nThe following example creates a static blog server within an [Express](http://expressjs.com/) app.\n\n```javascript\nvar http = require('http')\n  , kepler = require('../index')\n  , express = require('express');\n  \napp = express();\n\napp.use(express.static('test/'));\n\napp.use(kepler.parse('test/fixtures'));\n\napp.use(kepler.render({\n  engine: 'ejs',\n  layout: 'test/layout.ejs'\n}));\n\napp.use(kepler.dirParse({\n  location: 'test/fixtures',\n  limit: 1, // pagination with only 1 blog entry per page.\n  sort: 'date', // sort by date\n  sortOrder: -1 // Desc\n}));\n\napp.use(kepler.dirRender({\n  engine: 'ejs',\n  layout: 'test/blogLayout.ejs'\n}));\n\nhttp.createServer(app).listen(3000);\nconsole.log('listening on port 3000');\n```\n\nlayout.ejs:\n\n```html\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title></title>\n  <script src=\"/prettyprint.js\"></script>\n</head>\n<body>\n  <h1><%= title %></h1>\n  <p><%= date %></p>\n  <p><%= intro %></p>\n  <%- __content %>\n</body>\n</html>\n```\n\nblogLayout.ejs:\n\n```html\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title></title>\n</head>\n<body>\n    <% files.forEach(function(file) { %>\n    <h2><%= file.title %></h2>\n    <p><%= file.date %></p>\n    <% }); %>\n</body>\n</html>\n```\n\n`test/fixtures` contains a `2013` directory which houses two md files with [js-yaml-front-matter](https://github.com/dworthen/js-yaml-front-matter)(optional). The md files contain yaml front matter with title and date fields:\n\n```\n---\ntitle: \"Test Site\"\nintro: \"Intro Paragraph\"\ndate: '07-10-2013'\n---\nTHIS IS A TEST\n==============\n```\n\nVisiting `http://localhost:3000/2013` will produce: \n\n```html   \n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title></title>\n</head>\n<body>\n    \n    <h2>Test Site</h2>\n    <p>07-10-2013</p>\n    \n    <h2>Z title</h2>\n    <p>01-10-1990</p>\n    \n</body>\n</html>\n```\n\nA pagination url is also available, `http://localhost:3000/2013/1` will display all the blog posts on page 1. This example is not too interesting since we are limiting each page to displaying one entry and since there are two md files then there are two pages, `/1` and `/2`.\n\nAnd visiting `http://localhost:3000/2013/test` will produce:\n\n```html\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title></title>\n  <script src=\"/prettyprint.js\"></script>\n</head>\n<body>\n  <h1>Test Site</h1>\n  <p>07-10-2013</p>\n  <p>Intro Paragraph</p>\n  <h1>THIS IS A TEST</h1>\n</body>\n</html>\n```\n\n## API - v0.2.4\n\n### kepler.parse(location|String)\n\nParses a single md file that may contain [js-yaml-front-matter](https://github.com/dworthen/js-yaml-front-matter).\n\n#### Parameters \n\n- `location`: where the markdown files are hosted.\n\nThe contents of markdown files will be parsed with [js-yaml-front-matter](https://github.com/dworthen/js-yaml-front-matter) and the resulting object will be added to the `req` body under the kepler property. `req.kepler.files[0].__content` will be parsed with [markdown-js](https://github.com/evilstreak/markdown-js). \n\n### kepler.render(options|Object)\n\nRenders a single md file using a templating engine.\n\n#### Parameters\n\n- `options`: \n  - `layout`: `String` a layout template file.\n  - `engine`: `String` templating engine to be used (uses [consolidate.js](https://github.com/visionmedia/consolidate.js)). \n\n### kepler.dirParse(options|Object)\n\nParses a directory of md files.\n\n#### Parameters\n\n- `options`:\n  - `location`: `String` base directory to render md files from. Often times this will be the same location passed to `kepler.parse`.\n  - `limit`: `Number` the number of blog posts to display per page.\n  - `sort`: `String` the field to sort the files by. \n  - `sortOrder`: `Number` 1 for Ascending and -1 for descending.\n\nThe dirParse middleware attaches a list of files to the `req.kepler`. The files are ordered based on the sort field provided or by filename if a sort field is not provided. A `paginate` object is also created that contains information that can be used in a layout file to create a pagination functionality.\n\nHere is an example of the type of object returned by dirParse.\n\n```javascript\n{ files:\n  [ { title: 'Test Site',\n      intro: 'Intro Paragraph',\n      date: '07-10-2013',\n      __content: '<h1>THIS IS A TEST</h1>',\n      location: 'test/fixtures/2013/test.md',\n      basename: 'test.md' },\n    { title: 'Z title',\n      intro: 'Intro Paragraph',\n      date: '01-10-1990',\n      __content: '<h1>THIS IS A TEST</h1>',\n      location: 'test/fixtures/2013/z.md',\n      basename: 'z.md' } ],\n  paginate: {\n    total: 2, // Total nmber of pages\n    current: 1 // the current page if visiting /2013/1\n  }\n```\n\n### kepler.dirRender(options|Object)\n\nRenders a list of md files created by `kepler.dirParse` using a templating engine.\n\n#### Parameters\n\n- `options`: \n  - `layout`: `String` a layout template file.\n  - `engine`: `String` templating engine to be used (uses [consolidate.js](https://github.com/visionmedia/consolidate.js)). \n\n## Running the example\n\n```shell\ngit clone https://github.com/dworthen/node-kepler.git\ncd node-kepler\nnpm install --dev\nnode test/server.js\n```\n\nView `http://localhost:3000/2013` to view a list of blog entries, click on a title to see a specific blog entry.\n\n## Changelog\n\nVersion 0.2.4, dirParse no longer provides file stats.\n\nVersion >= 0.2.1 no longer renders markdown files directly but instead parses the file using js-yaml-front and markdown-js and passes the resulting object through the req body. This allows for people to write connect middleware to pre/post modify the parsed file.  \n\nVersion 0.2.x is a complete overhaul from previous versions. Previous versions were poor attempts to be a Jekyll clone. Without a clear vision or problem to solve Kepler v0.1.x was convoluted solution for producing static websites. \n\nVersion 0.2.x points Kepler into a new direction. Kepler is no longer a tool for building static websites but is now aiming to be a simple blog generator. Kepler is a connect middleware that will serve up markdown (.md) files.\n\n## TODO\n\n- Document creating pagination functionality.\n\n## License\n\nCopyright (c) 2011 Derek Worthen\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"readme.md","_id":"kepler@0.2.4","dist":{"shasum":"c376d9e047f70d8f123122645cde928e41fa2363","tarball":"https://registry.npmjs.org/kepler/-/kepler-0.2.4.tgz","integrity":"sha512-+/4tDYSokxZQPRhPYDR10DFWbxoGqU+9LSlhh41myBeCXY+R1KtMxTgMX3guTnEugeuUJe/2dvDM4Ym8sMI+SQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDkzRgG5KFiSwTxps88JoVK5yF6OwOGPE6t3oIvCSyCoAiEAjbXrM05RWTIMiTyIxBUsZvKFNJstTnbtMbobZ58WFV8="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"dworthen","email":"worthend.derek@gmail.com"},"maintainers":[{"name":"dworthen","email":"worthend.derek@gmail.com"}],"directories":{}},"1.0.0":{"name":"kepler","version":"1.0.0","description":"Kapler will no longer support previous content after version 1.0, so if you need to use previous features, please lock the version.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"witt","url":"unix.bio@gmail.com"},"license":"MIT","_id":"kepler@1.0.0","_nodeVersion":"16.3.0","_npmVersion":"7.18.1","dist":{"integrity":"sha512-p16wfgRlkNXFAVfs1R5JwWcq87l5B+FlHp4FrqfRr+RY8Ioh2OvhPEt/bvREDWP1Z6xNrTTPpvlUqlWjMnDrKQ==","shasum":"e0de4998f118757570982aa59bf55658e08dc705","tarball":"https://registry.npmjs.org/kepler/-/kepler-1.0.0.tgz","fileCount":11,"unpackedSize":6151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0pPsCRA9TVsSAnZWagAAuTEP/RPfXg6KM6jQRQumNRNB\nz2sjrAIUU8DxAVH7DianpLMqeoR+hVL+sUbk0ZbcpxM7u2S/AcrGYZ5kA5Zb\npY8HzAc4p6lTTsAToned3mK9+phxMf1WsXfw1oFbVanIHY1QrX3l2Ty/hXVG\ng+3iIETk7azEKdT8ruJGNcFPwtIflNBDgOB80vR8UvcD5JSS76Z9U3vV8vYY\ned5IUWhsegbyLembzXuJGQ58AUP9Iru9HaSwjovcqv0J25EUJ3J8N1HsngZd\nSa/48nQKA0KoI/fXe7LzcMgjJ81k8lkIHFX2xPyq5IOWvv2UVKzXw6nsED1k\nLwz7CtANfSwwu9/AIt51q0PU18zCH6s8xmYzLJEeBHyL6eF3nkaOd0nc3gjG\nX1eCvPWat9A3Yd+xNPVzRmtG57fiOQQKkO9srjN6zHOaYpSRmHM9taAvxeGb\nVz9ImV8kZItEifO6IGIqvbmF7R5C9cXlRCRvfYh0syC6vwLIwmsirfLa+Jlf\n8HiOazWywM+OChuLCIqQMnikw0a9+L6PDWDMulfTaC2m/JRQvze83OYf716p\neVeskvxyHCHVQDpi8eRs54CwWZZd2yp/GsJHfzkhxslqP5jxSD8xOVtJX45W\nYoPlTpFBwFFI6d06DZPeRWoKallYCycy6aGXbFTbYK++e3L11a9ll36OqZb9\nu8iG\r\n=OKvS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC91WAfz85MdcTh/ogv7Jecg66ioqaOkpxz1xmkZwSC5QIgJQoB+3KS+4uCW0gX9RrZWxbNJGIfkcguzDAvR7A07Zo="}]},"_npmUser":{"name":"echo_unix","email":"unix.bio@gmail.com"},"directories":{},"maintainers":[{"name":"dworthen","email":"worthend.derek@gmail.com"},{"name":"echo_unix","email":"unix.bio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/kepler_1.0.0_1624413163767_0.3909389573890516"},"_hasShrinkwrap":false}},"maintainers":[{"email":"unix.bio@gmail.com","name":"echo_unix"}],"time":{"modified":"2024-02-02T07:04:13.732Z","created":"2011-10-30T20:05:45.368Z","0.0.1":"2011-10-30T20:05:48.537Z","0.0.11":"2011-10-30T21:33:42.670Z","0.1.0":"2011-11-16T05:09:13.297Z","0.2.0":"2013-09-05T02:02:39.243Z","0.2.1":"2013-09-17T06:28:06.765Z","0.2.2":"2013-09-18T03:35:55.207Z","0.2.3":"2013-09-19T04:17:18.639Z","0.2.4":"2013-11-06T05:42:40.100Z","1.0.0":"2021-06-23T01:52:43.869Z"},"author":{"name":"witt","url":"unix.bio@gmail.com"},"description":"Kapler will no longer support previous content after version 1.0, so if you need to use previous features, please lock the version.","users":{"pvorb":true},"license":"MIT","readme":"## Kepler v1.x\n\nKapler will no longer support previous content after version 1.0, so if you need to use previous features, please lock the version.\n","readmeFilename":"README.md"}