Permalink
Browse files

Added some documentation in readme :)

  • Loading branch information...
1 parent 0a99db2 commit e4782fe7a0c53a26c88d3335deb4b05796fd8931 @temsa committed Feb 26, 2011
Showing with 28 additions and 1 deletion.
  1. +28 −1 README.markdown
View
@@ -2,12 +2,39 @@
Wheat is a blogging engine that reads a git repo full of markdown articles and presents them as a website.
+Wheat engine takes a local git repository path as a parameter
+
+ var wheat = require('wheat')("/path/to/my/repo");
+ // wheat is now a function which handles request and return response:
+ // wheat(req/*request*/, res/*response*/, next /*next handler to call for this request*/)
+
+Here's an example using Connect ( npm install connect ) to start a server, adapted from https://github.com/creationix/howtonode.org/blob/master/app.js :
+
+ var Connect = require('connect');
+
+ var repository = "/path/to/my/repo",
+ port = 3000;
+
+ Connect.createServer(
+ Connect.logger(),
+ Connect.conditionalGet(),
+ Connect.favicon(),
+ Connect.cache(),
+ Connect.gzip(),
+ require('wheat')(repository)
+ ).listen(port);
+
## How to Install
-Either manually install all the dependencies or use npm. It's packaged nicely now.
+Either manually install all the dependencies or use npm.
npm install wheat
+## Full example of how to use wheat :
+ $> npm install wheat
+ $> git clone https://github.com/creationix/howtonode.org.git
+ $> cd howtonode.org
+ $> node app.js
That's it! Checkout the wheat branch of howtonode.org for an example of how to use the library.

0 comments on commit e4782fe

Please sign in to comment.