Permalink
Browse files

update documentation

  • Loading branch information...
1 parent 6646f29 commit dbe4e06313c1fbfad5a7df90a63188347586af87 @twilson63 committed Mar 24, 2012
Showing with 34 additions and 6 deletions.
  1. +16 −5 docs/index.html
  2. +17 −1 index.coffee
  3. +1 −0 readme.md
View
@@ -1,8 +1,19 @@
<!DOCTYPE html> <html> <head> <title>index.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> index.coffee </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <h1>flatiron handlers</h1>
-<h2>Contants</h2> </td> <td class="code"> <div class="highlight"><pre><span class="nv">PLAIN = </span><span class="s1">&#39;text/plain&#39;</span>
+<p>usage</p>
+
+<pre><code>flatiron = require 'flatiron'
+handlers = require 'flatiron-handlers'
+app = flatiron.app
+
+app.use flatiron.plugins.http
+app.use handlers
+
+app.router.get '/', -&gt;
+ app.plain res, 'foo'
+</code></pre> </td> <td class="code"> <div class="highlight"><pre> </pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <h2>Contants</h2> </td> <td class="code"> <div class="highlight"><pre><span class="nv">PLAIN = </span><span class="s1">&#39;text/plain&#39;</span>
<span class="nv">HTML = </span><span class="s1">&#39;text/html&#39;</span>
-<span class="nv">APP_JSON = </span><span class="s1">&#39;application/json&#39;</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <h1>Public methods</h1> </td> <td class="code"> <div class="highlight"><pre><span class="nv">exports.attach = </span><span class="nf">(options) -&gt;</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <h2>app.plain(res, text)</h2>
+<span class="nv">APP_JSON = </span><span class="s1">&#39;application/json&#39;</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <h1>Public methods</h1> </td> <td class="code"> <div class="highlight"><pre><span class="nv">exports.attach = </span><span class="nf">(options) -&gt;</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <h2>app.plain(res, text)</h2>
<pre><code> Parameter | Type | Required | Description
-----------|--------|-------------|-------------
@@ -21,7 +32,7 @@
});
</code></pre> </td> <td class="code"> <div class="highlight"><pre> <span class="vi">@plain = </span><span class="nf">(res, text) -&gt;</span>
<span class="nx">res</span><span class="p">.</span><span class="nx">writeHead</span> <span class="mi">200</span><span class="p">,</span> <span class="s1">&#39;content-type&#39;</span><span class="o">:</span> <span class="nx">PLAIN</span>
- <span class="nx">res</span><span class="p">.</span><span class="nx">end</span> <span class="nx">text</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <h2>app.html(res, html)</h2>
+ <span class="nx">res</span><span class="p">.</span><span class="nx">end</span> <span class="nx">text</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <h2>app.html(res, html)</h2>
<pre><code>Parameter | Type | Required | Description
-----------|--------|-------------|--------------
@@ -40,7 +51,7 @@
});
</code></pre> </td> <td class="code"> <div class="highlight"><pre> <span class="vi">@html = </span><span class="nf">(res, html) -&gt;</span>
<span class="nx">res</span><span class="p">.</span><span class="nx">writeHead</span> <span class="mi">200</span><span class="p">,</span> <span class="s1">&#39;content-type&#39;</span><span class="o">:</span> <span class="nx">HTML</span>
- <span class="nx">res</span><span class="p">.</span><span class="nx">end</span> <span class="nx">html</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <h2>app.redirect(res, location)</h2>
+ <span class="nx">res</span><span class="p">.</span><span class="nx">end</span> <span class="nx">html</span></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">&#182;</a> </div> <h2>app.redirect(res, location)</h2>
<pre><code>Parameter | Type | Required | Description
-----------|--------|-------------|--------------
@@ -59,7 +70,7 @@
});
</code></pre> </td> <td class="code"> <div class="highlight"><pre> <span class="vi">@redirect = </span><span class="nf">(res, location) -&gt;</span>
<span class="nx">res</span><span class="p">.</span><span class="nx">writeHead</span> <span class="mi">303</span><span class="p">,</span> <span class="nv">Location: </span><span class="nx">location</span>
- <span class="nx">res</span><span class="p">.</span><span class="nx">end</span><span class="p">()</span></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">&#182;</a> </div> <h2>app.json(res, data, status)</h2>
+ <span class="nx">res</span><span class="p">.</span><span class="nx">end</span><span class="p">()</span></pre></div> </td> </tr> <tr id="section-7"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-7">&#182;</a> </div> <h2>app.json(res, data, status)</h2>
<pre><code>Parameter | Type | Required | Description
-----------|--------|-------------|--------------
View
@@ -1,5 +1,21 @@
-# # flatiron handlers
+# # flatiron-handlers
+# install
#
+# npm install flatiron-handlers
+#
+# usage
+#
+# flatiron = require 'flatiron'
+# handlers = require 'flatiron-handlers'
+# app = flatiron.app
+#
+# app.use flatiron.plugins.http
+# app.use handlers
+#
+# app.router.get '/', ->
+# app.plain res, 'foo'
+#
+
# ## Contants
PLAIN = 'text/plain'
HTML = 'text/html'
View
@@ -13,6 +13,7 @@ methods to the flatiron http application:
``` coffeescript
flatiron = require 'flatiron'
+handlers = require 'flatiron-handlers'
app = flatiron.app
app.use flatiron.plugins.http

0 comments on commit dbe4e06

Please sign in to comment.