Skip to content
Browse files

0.3. Generation and server are going

  • Loading branch information...
1 parent 23b5733 commit 47d182a43124c9ef86d5c4109c3303bf2f188f6d @balupton balupton committed
Showing with 33 additions and 41 deletions.
  1. +21 −8 README.md
  2. +5 −27 lib/main.js
  3. +7 −6 package.json
View
29 README.md
@@ -3,7 +3,7 @@
## Huh?
-DocPad (like Jekyll) renders static markup documents into rich static documents. In other words, it does this:
+DocPad (like Jekyll) renders static markup documents into rich static documents. In other words:
- Before:
@@ -37,6 +37,11 @@ DocPad (like Jekyll) renders static markup documents into rich static documents.
* [Node.js](http://nodejs.org) - Server Side Javascript
* [Express.js](http://expressjs.com/) - The "Server" in Server Side Javascript
+* [Markdown](http://daringfireball.net/projects/markdown/basics) - Markup Made Easy
+* [Jade](https://github.com/visionmedia/jade) - HTML Made Easy
+* [Eco](https://github.com/sstephenson/eco) - Templating Made Easy
+* [Mongoose](https://github.com/learnboost/mongoose/) - MongoDB Made Easy
+* [Async](https://github.com/caolan/async) - Asynchrounous Programming Made Easy
## Install
@@ -45,6 +50,10 @@ DocPad (like Jekyll) renders static markup documents into rich static documents.
## Usage
+- To generate the rendered website, watch the files for changes, and run the docpad server
+
+ docpad
+
- To generate a basic website structure in the current working directory
docpad skeleton
@@ -69,22 +78,26 @@ DocPad (like Jekyll) renders static markup documents into rich static documents.
* Support layouts
* Support meta-data
* Support css (e.g. less and css)
-* Support tempalting languages (e.g. ejs and eco)
+* Support tempalting languages (e.g. eco)
* Support markup lanagues (e.g. markdown and jade)
* Support generation of a static website
-* Support generation of PDF documents
+* Support generation of PDF documents (not yet done)
### Server
-* Support dynamic pages which won't be generated statically
-* Add NowPad support for interface
-* Add user management
-* Add revision history
-* Add deployment options
+* Serve the generated static website
+* Support dynamic pages which won't be generated statically (not yet done)
+* Add NowPad support for interface (not yet done)
+* Add user management (not yet done)
+* Add revision history (not yet done)
+* Add deployment options (not yet done)
## History
+- v0.3 May 7, 2011
+ - Got the generation and server going
+
- v0.2 March 24, 2011
- Prototyping with DisenchantCH
View
32 lib/main.js
@@ -6,6 +6,7 @@ var
yaml = require('yaml'),
express = require('express'),
gfm = require('github-flavored-markdown'),
+ jade = require('jade'),
eco = require('eco'),
path = require('path'),
async = require('async'),
@@ -198,6 +199,10 @@ var DocPad = {
// Markup
fileMeta.extension = path.extname(fileFullPath);
switch ( fileMeta.extension ) {
+ case '.jade':
+ result = jade.render(fileBody);
+ break;
+
case '.md':
fileMeta.content = gfm.parse(fileBody);
break;
@@ -557,33 +562,6 @@ var DocPad = {
},
/**
- * Render the Supported File
- */
- renderSupportedFile: function(filePath){
- // Prepare
- var
- extension = path.extname(filePath),
- result = false;
-
- // Render
- switch ( extension ) {
- case '.md':
- result = gfm.parse(fs.readFileSync(filePath).toString());
- break;
-
- case '.html':
- result = fs.readFileSync(filePath).toString();
- break;
-
- default:
- break;
- }
-
- // Return
- return result;
- },
-
- /**
* Get Support File
*/
getSupportedFile: function(filePath){
View
13 package.json
@@ -44,12 +44,13 @@
"url" : "http://github.com/balupton/docpad.git"
},
"dependencies": {
- "now": ">=0.5.2",
- "express": ">=2.2.2",
- "ejs": ">=0.4.1",
- "es5-shim": "1.0.0",
- "nowpad": ">=0.1.0",
- "yaml": ">=0.1.0"
+ "mongoose": ">=1.3.3",
+ "github-flavored-markdown": ">=1.0.0",
+ "jade": ">=0.10.7",
+ "eco": ">=1.0.3",
+ "async": ">=0.1.9",
+ "express": ">=2.3.2",
+ "yaml": ">=0.1.2"
},
"engines" : {
"node": ">=0.4.0"

0 comments on commit 47d182a

Please sign in to comment.
Something went wrong with that request. Please try again.