Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added some docs

  • Loading branch information...
commit fa87f20219aa59df0dffefb7a448d6d606f4e0ab 1 parent 4838b7e
@hkjels authored
View
12 Makefile
@@ -3,7 +3,7 @@
# Procedures
-docs: docs/crud.json
+docs: docs/index.html
lint:
./node_modules/.bin/jshint crud.js
@@ -14,7 +14,7 @@ test:
clean: cleandocs
cleandocs:
- rm -rf docs
+ rm -rf docs/*.html
# Aliases
@@ -34,6 +34,8 @@ with:
# Compile
-docs/crud.json: crud.js
- mkdir -p docs
- ./node_modules/.bin/dox < $< > $@
+docs/index.html: docs/layout/head.html docs/Readme.html docs/layout/tail.html
+ cat $^ > $@
+
+docs/%.html: docs/%.md
+ ./node_modules/.bin/marked $< > $@
View
65 docs/Readme.md
@@ -0,0 +1,65 @@
+# crud
+
+__Crud functionality for mongoose-models. Fits well with express.js__
+
+
+## Install
+
+ λ npm install crud
+
+
+## With express.js magic
+
+ var express = require('express')
+ , app = module.exports = express.createServer()
+ , models = require('./models')
+ , crud = require('crud')
+
+ app.get('/crud/:model', crud.middleware, function (req, res) {
+ res.render('crud')
+ })
+
+
+## Without express.js magic
+
+ var mongoose = require('mongoose')
+ , Model = mongoose.model('Model')
+ , crud = require('crud').form
+
+ crud(Model, function (err, form) {
+ if (err) return console.err(err)
+ console.dir(form)
+ })
+
+
+## Constributors
+
+* Henrik Kjelsberg <hkjels@me.com>
+[github](http://github.com/hkjels/ "Github account")
+[website](http://take.no/ "Development blog")
+
+
+## License
+
+> (The MIT License)
+>
+> Copyright (c) 2012 Henrik Kjelsberg &lt;henrik@kjelsberg.net&gt;
+>
+> Permission 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:
+>
+> The above copyright notice and this permission notice shall be
+> included in all copies or substantial portions of the Software.
+>
+> THE 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.
View
37 docs/layout/head.html
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <title>Crud</title>
+ <style type="text/css">
+ body {
+ background-color: #eaeaea;
+ color: #333;
+ font-family: Helvetica, Arial;
+ padding: 50px;
+ text-align: center;
+ text-shadow: 0 1px 0 white;
+ }
+ #wrapper {
+ margin: 0 auto;
+ max-width: 540px;
+ text-align: left;
+ }
+ h1 {
+ font-size: 4em;
+ line-height: 0;
+ }
+ p strong, pre {
+ display: block;
+ margin-bottom: 50px;
+ }
+ </style>
+ <link rel="stylesheet" href="http://yandex.st/highlightjs/6.2/styles/github.min.css">
+ <script src="http://yandex.st/highlightjs/6.2/highlight.min.js"></script>
+ <script type="text/javascript">
+ hljs.initHighlightingOnLoad()
+ </script>
+</head>
+<body>
+ <div id="wrapper">
+
View
3  docs/layout/tail.html
@@ -0,0 +1,3 @@
+ </div>
+</body>
+</html>
View
2  package.json
@@ -10,6 +10,7 @@
, "repository": "git://github.com/hkjels/crud.git"
, "scripts": {
"prepublish": "make mocha with cream and sugar"
+ , "start": "node examples/user/app"
, "test": "make mocha"
}
, "dependencies": {
@@ -21,6 +22,7 @@
, "express": "2.5.9"
, "jade": "0.26.0"
, "jshint": ">= 0.7.0"
+ , "marked": "0.2.5"
, "mocha": "1.0.3"
, "nib": "0.4.1"
, "should": "0.6.3"
Please sign in to comment.
Something went wrong with that request. Please try again.