Merge pull request #234 from anatoliychakkaev/master

Documentation in man and html
This commit is contained in:
Anatoliy Chakkaev 2013-03-23 11:52:31 -07:00
commit bb5cb50b85
9 changed files with 414 additions and 4 deletions

2
.gitignore vendored
View File

@ -7,3 +7,5 @@ v8.log
.DS_Store .DS_Store
benchmark.js benchmark.js
analyse.r analyse.r
docs/html
docs/man

View File

@ -1,8 +1,33 @@
doc: # doc:
makedoc lib/abstract-class.js lib/schema.js lib/validatable.js -t "JugglingDB API docs" # makedoc lib/abstract-class.js lib/schema.js lib/validatable.js -t "JugglingDB API docs"
test: test:
@./node_modules/.bin/mocha --require should test/*.test.js @./node_modules/.bin/mocha --require should test/*.test.js
.PHONY: test MAN_DOCS = $(shell find docs -name '*.md' \
.PHONY: doc |sed 's|.md|.3|g' \
|sed 's|docs/|docs/man/|g' )
HTML_DOCS = $(shell find docs -name '*.md' \
|sed 's|.md|.3.html|g' \
|sed 's|docs/|docs/html/|g' ) \
docs/html/index.html
docs/man/%.3: docs/%.md scripts/doc.sh
scripts/doc.sh $< $@
docs/html/%.3.html: docs/%.md scripts/doc.sh
scripts/doc.sh $< $@
docs/html/index.html: docs/jugglingdb.md scripts/doc.sh
scripts/doc.sh $< $@
man: $(MAN_DOCS)
html: $(HTML_DOCS)
release: man
web: html
rsync ./docs/html/* jugglingdb.co:/var/www/apps/jugglingdb.co/public
.PHONY: test docs

17
docs/changelog.md Normal file
View File

@ -0,0 +1,17 @@
jugglingdb-changelog(3) - The History of JugglingDB
===================================================
## HISTORY
### upcoming release
### 0.2.1
### 0.2.0
### 0.1.27
### 0.1.23
### 0.1.21
### 0.1.1
### 0.0.4
### 0.0.2

197
docs/html/index.html Normal file
View File

@ -0,0 +1,197 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='content-type' value='text/html;charset=utf8'>
<meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
<title>JugglingDB(3) - cross-database ORM for nodejs and browser</title>
<style type='text/css' media='all'>
/* style: man */
body#manpage {margin:0}
.mp {max-width:100ex;padding:0 9ex 1ex 4ex}
.mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
.mp h2 {margin:10px 0 0 0}
.mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
.mp h3 {margin:0 0 0 4ex}
.mp dt {margin:0;clear:left}
.mp dt.flush {float:left;width:8ex}
.mp dd {margin:0 0 0 9ex}
.mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
.mp pre {margin-bottom:20px}
.mp pre+h2,.mp pre+h3 {margin-top:22px}
.mp h2+pre,.mp h3+pre {margin-top:5px}
.mp img {display:block;margin:auto}
.mp h1.man-title {display:none}
.mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
.mp h2 {font-size:16px;line-height:1.25}
.mp h1 {font-size:20px;line-height:2}
.mp {text-align:justify;background:#fff}
.mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
.mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
.mp u {text-decoration:underline}
.mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
.mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
.mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
.mp b.man-ref {font-weight:normal;color:#434241}
.mp pre {padding:0 4ex}
.mp pre code {font-weight:normal;color:#434241}
.mp h2+pre,h3+pre {padding-left:0}
ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
ol.man-decor {width:100%}
ol.man-decor li.tl {text-align:left}
ol.man-decor li.tc {text-align:center;letter-spacing:4px}
ol.man-decor li.tr {text-align:right;float:right}
</style>
<style type='text/css' media='all'>
/* style: toc */
.man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
.man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
.man-navigation a:hover {color:#111;text-decoration:underline}
</style>
</head>
<!--
The following styles are deprecated and will be removed at some point:
div#man, div#man ol.man, div#man ol.head, div#man ol.man.
The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
.man-navigation should be used instead.
-->
<body id='manpage'>
<div class='mp' id='man'>
<div class='man-navigation' style='display:none'>
<a href="#NAME">NAME</a>
<a href="#DESCRIPTION">DESCRIPTION</a>
<a href="#INSTALLATION">INSTALLATION</a>
<a href="#DOCUMENTATION">DOCUMENTATION</a>
<a href="#ADAPTERS">ADAPTERS</a>
<a href="#CONTRIBUTION">CONTRIBUTION</a>
<a href="#FUTURE">FUTURE</a>
<a href="#BUGS">BUGS</a>
<a href="#HISTORY">HISTORY</a>
<a href="#LICENSE">LICENSE</a>
<a href="#AUTHOR">AUTHOR</a>
<a href="#CONTRIBUTORS">CONTRIBUTORS</a>
<a href="#SEE-ALSO">SEE ALSO</a>
</div>
<ol class='man-decor man-head man head'>
<li class='tl'>JugglingDB(3)</li>
<li class='tc'>JugglingDB</li>
<li class='tr'>JugglingDB(3)</li>
</ol>
<h2 id="NAME">NAME</h2>
<p class="man-name">
<code>JugglingDB</code> - <span class="man-whatis">cross-database ORM for nodejs and browser</span>
</p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<p>JugglingDB is cross-db ORM for nodejs, providing <strong>common interface</strong> to access
most popular database formats. Currently supported are: mysql, sqlite3,
postgres, couchdb, mongodb, redis, neo4j and in-memory-storage.</p>
<p>JugglingDB also works on client-side (using WebService and Memory adapters),
which allows to write rich client-side apps talking to server using JSON API.</p>
<h2 id="INSTALLATION">INSTALLATION</h2>
<p>Use npm to install core package:</p>
<pre><code>npm install jugglingdb --save
</code></pre>
<p>Alternatively you can install jugglingdb core from github:</p>
<pre><code>npm install 1602/jugglingdb
</code></pre>
<p>Then install adapter for specific database, for example <code>jugglingdb-redis</code>:</p>
<pre><code>npm install jugglingdb-redis
</code></pre>
<p>See <span class="man-ref">jugglingdb-adapters<span class="s">(3)</span></span> for list of available adapters.</p>
<h2 id="DOCUMENTATION">DOCUMENTATION</h2>
<p>Autogenerated documentation available at <a href="https://jsdoc.info/1602/jugglingdb">jsdoc.info/1602/jugglingdb</a>. Human-written manual sections are:</p>
<dl>
<dt><a class="man-ref" href="schema.3.html">jugglingdb-schema<span class="s">(3)</span></a></dt><dd><p>Everything about schema, data types and model definition.</p></dd>
<dt><a class="man-ref" href="model.3.html">jugglingdb-model<span class="s">(3)</span></a></dt><dd><p>Model methods, features and internals.</p></dd>
<dt><a class="man-ref" href="validations.3.html">jugglingdb-validations<span class="s">(3)</span></a></dt><dd><p>Built-in validators, creating custom validations, syncronous and asyncronous
object validation.</p></dd>
<dt><a class="man-ref" href="hooks.3.html">jugglingdb-hooks<span class="s">(3)</span></a></dt><dd><p>Hooks and object lifecycle.</p></dd>
</dl>
<h2 id="ADAPTERS">ADAPTERS</h2>
<h2 id="CONTRIBUTION">CONTRIBUTION</h2>
<h2 id="FUTURE">FUTURE</h2>
<p>See <a class="man-ref" href="roadmap.3.html">jugglingdb-roadmap<span class="s">(3)</span></a> and [github issues][issues] to catch up current
development and see how you can help jugglingdb to grow up.</p>
<h2 id="BUGS">BUGS</h2>
<p>When you find issues, please report them:</p>
<dl>
<dt>github/core</dt><dd><a href="https://github.com/1602/jugglingdb/issues" data-bare-link="true">https://github.com/1602/jugglingdb/issues</a></dd>
<dt>github/adapters</dt><dd><a href="https://github.com/jugglingdb" data-bare-link="true">https://github.com/jugglingdb</a></dd>
<dt class="flush">email</dt><dd><a href="&#109;&#97;&#105;&#108;&#116;&#x6f;&#58;&#99;&#x6f;&#x6d;&#112;&#x6f;&#117;&#110;&#x64;&#106;&#115;&#64;&#103;&#111;&#x6f;&#x67;&#108;&#x65;&#x67;&#114;&#x6f;&#117;&#x70;&#115;&#x2e;&#x63;&#111;&#109;" data-bare-link="true">&#x63;&#x6f;&#x6d;&#112;&#x6f;&#117;&#x6e;&#x64;&#x6a;&#x73;&#x40;&#103;&#x6f;&#111;&#103;&#x6c;&#101;&#103;&#x72;&#111;&#x75;&#112;&#x73;&#x2e;&#99;&#111;&#x6d;</a></dd>
</dl>
<h2 id="HISTORY">HISTORY</h2>
<p>See <a class="man-ref" href="changelog.3.html">jugglingdb-changelog<span class="s">(3)</span></a></p>
<h2 id="LICENSE">LICENSE</h2>
<p>JugglingDB has MIT license, see <span class="man-ref">jugglingdb-license<span class="s">(3)</span></span> for details.</p>
<h2 id="AUTHOR">AUTHOR</h2>
<ul>
<li><a href="http://anatoliy.in/">blog</a></li>
<li><a href="https://github.com/1602/">github/1602</a></li>
<li><a href="https://github.com/anatoliychakkaev/">github/anatoliychakkaev</a></li>
<li><a href="http://twitter.com/1602">twitter@1602</a></li>
<li><a href="&#109;&#x61;&#105;&#108;&#116;&#x6f;&#x3a;&#109;&#97;&#x69;&#x6c;&#x40;&#97;&#110;&#x61;&#116;&#x6f;&#x6c;&#105;&#x79;&#x2e;&#105;&#110;" data-bare-link="true">&#x6d;&#97;&#105;&#108;&#x40;&#97;&#110;&#97;&#116;&#x6f;&#108;&#105;&#121;&#x2e;&#x69;&#110;</a></li>
</ul>
<h2 id="CONTRIBUTORS">CONTRIBUTORS</h2>
<h3 id="core-contributors-more-than-1-">core contributors (more than 1%)</h3>
<pre><code>410 Anatoliy Chakkaev 73.9%
31 Sébastien Drouyer 5.6%
25 1602 4.5%
9 Muneeb Samuels 1.6%
6 Henri Bergius 1.1%
</code></pre>
<h3 id="adapters-maintainers">adapters maintainers</h3>
<ul>
<li><a href="https://github.com/jugglingdb/nano-adapter">jugglingdb-nano</a> -- <a href="https://github.com/nrw">Nicholas Westlake</a></li>
</ul>
<h2 id="SEE-ALSO">SEE ALSO</h2>
<ol class='man-decor man-foot man foot'>
<li class='tl'>1602 Software</li>
<li class='tc'>March 2013</li>
<li class='tr'>JugglingDB(3)</li>
</ol>
</div>
</body>
</html>

9
docs/index.txt Normal file
View File

@ -0,0 +1,9 @@
jugglingdb(3) index
jugglingdb-changelog(3) changelog.3
jugglingdb-roadmap(3) roadmap.3
jugglingdb-validations(3) validations.3
jugglingdb-hooks(3) hooks.3
jugglingdb-schema(3) schema.3
jugglingdb-model(3) model.3
jugglingdb-nano https://github.com/jugglingdb/nano-adapter

101
docs/jugglingdb.md Normal file
View File

@ -0,0 +1,101 @@
JugglingDB(3) - cross-database ORM for nodejs and browser
=========================================================
## DESCRIPTION
JugglingDB is cross-db ORM for nodejs, providing **common interface** to access
most popular database formats. Currently supported are: mysql, sqlite3,
postgres, couchdb, mongodb, redis, neo4j and in-memory-storage.
JugglingDB also works on client-side (using WebService and Memory adapters),
which allows to write rich client-side apps talking to server using JSON API.
## INSTALLATION
Use npm to install core package:
npm install jugglingdb --save
Alternatively you can install jugglingdb core from github:
npm install 1602/jugglingdb
Then install adapter for specific database, for example `jugglingdb-redis`:
npm install jugglingdb-redis
See jugglingdb-adapters(3) for list of available adapters.
## DOCUMENTATION
Autogenerated documentation available at [jsdoc.info/1602/jugglingdb](https://jsdoc.info/1602/jugglingdb). Human-written manual sections are:
* jugglingdb-schema(3):
Everything about schema, data types and model definition.
* jugglingdb-model(3):
Model methods, features and internals.
* jugglingdb-validations(3):
Built-in validators, creating custom validations, syncronous and asyncronous
object validation.
* jugglingdb-hooks(3):
Hooks and object lifecycle.
## ADAPTERS
## CONTRIBUTION
## FUTURE
See jugglingdb-roadmap(3) and [github issues][issues] to catch up current
development and see how you can help jugglingdb to grow up.
## BUGS
When you find issues, please report them:
* github/core:
<https://github.com/1602/jugglingdb/issues>
* github/adapters:
<https://github.com/jugglingdb>
* email:
<compoundjs@googlegroups.com>
## HISTORY
See jugglingdb-changelog(3)
## LICENSE
JugglingDB has MIT license, see jugglingdb-license(3) for details.
## AUTHOR
* [blog](http://anatoliy.in/)
* [github/1602](https://github.com/1602/)
* [github/anatoliychakkaev](https://github.com/anatoliychakkaev/)
* [twitter@1602](http://twitter.com/1602)
* <mail@anatoliy.in>
## CONTRIBUTORS
### core contributors (more than 1%)
410 Anatoliy Chakkaev 73.9%
31 Sébastien Drouyer 5.6%
25 1602 4.5%
9 Muneeb Samuels 1.6%
6 Henri Bergius 1.1%
### adapters maintainers
* [jugglingdb-nano] - [Nicholas Westlake](https://github.com/nrw)
* [jugglingdb-mysql] - [dgsan](https://github.com/dgsan)
* [jugglingdb-firebird] - [Henri Gourvest](https://github.com/hgourvest)
*NOTE:* Other adapters waits for their maintainers, drop a line to
mail@anatoliy.in if you want to maintain some adapter on regular basis.
## SEE ALSO

29
docs/roadmap.md Normal file
View File

@ -0,0 +1,29 @@
jugglingdb-roadmap - The Future of JugglingDB
=============================================
## DOCUMENTATION
### ENGINE
* web
* man
### SECTIONS
* hooks
* validations
* schema
* model
* adapters
* testing
## MODEL CORE
* virtual attributes
* object presentation modes
* mass-assignment protection
* destroy by query
## SCHEMA
* models merging

View File

@ -158,6 +158,8 @@ Schema.prototype.define = function defineClass(className, properties, settings)
if (args.length == 1) properties = {}, args.push(properties); if (args.length == 1) properties = {}, args.push(properties);
if (args.length == 2) settings = {}, args.push(settings); if (args.length == 2) settings = {}, args.push(settings);
settings = settings || {};
standartize(properties, settings); standartize(properties, settings);
// every class can receive hash of data as optional param // every class can receive hash of data as optional param

28
scripts/doc.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
src=$1
dest=$2
if ! [ `which ronn` ]; then
echo 'ronn rubygem is not installed, run "gem install ronn"'
exit 0
fi
mkdir -p $(dirname $dest)
# VERSION=$(grep version package.json | perl -pi -e 's/[^-\d\.]//g')
case $dest in
*.[13])
ronn --roff $1 --pipe --organization=1602\ Software --manual=JugglingDB > $2
exit $?
;;
*.html)
ronn -5 $1 --pipe\
--style=toc\
--organization=1602\ Software\
--manual=JugglingDB > $2
exit $?
;;
esac