Merge branch 'docs' into connect
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Tj Holowaychuk · committed by Tj Holowaychuk · parents 1aad62b, 3ced7b7 · Browse files · 12 files·+411 added−270 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
12 files+411 added−270 removed
- other:+411 added−270 removed
Provenance
- Commit
492f70f- Tree
76ef095- Author
Tj Holowaychuk <tj@vision-media.ca>- Committer
Tj Holowaychuk <tj@vision-media.ca>- Parent 1
1aad62b- Parent 2
3ced7b7
12 files changed+411 added−270 removed
modified:docs/layout/head.html+17 added
42 unmodified lines43444546474849505160 unmodified lines11211311411511611711811912012112212312412512612712812913013113213313413543 unmodified lines42 unmodified lines border: none !important; }
a { font-weight: bold; text-decoration: none; color: white; -webkit-transition-property: opacity, -webkit-transform, color, background-color, padding, -webkit-box-shadow; -webkit-transition-duration: 0.15s; -webkit-transition-timing-function: ease-out; }60 unmodified lines margin: 0 auto; padding-top: 110px; width: 550px; }
#toc { position: fixed; top: 60px; left: 0; margin: 0 0 0 15px; padding: 15px; height: 100%; background: rgba(0,0,0,0.2); border-right: 1px solid rgba(255,255,255,0.05); } #toc li { list-style: none; } #toc li a { font-size: 11px; } #menu { margin-left: 65px; padding: 0; padding-bottom: 30px; }43 unmodified linesmodified:docs/api.html+226 added-226 removed
149 unmodified lines150 <span class="variable">require</span>(<span class="string">'./request'</span>);151 <span class="variable">require</span>(<span class="string">'./response'</span>);152 </code></pre>153 </td>154-</tr><tr class="filename"><td><h2 id="lib/express/utils.js"><a href="#">utils</a></h2></td><td>lib/express/utils.js</td></tr><tr class="code">155-<td class="docs">156-<p>Parse mini markdown implementation.157-The following conversions are supported,158-primarily for the "flash" middleware:</p>159-160-<p> <em>foo</em> or <em>foo</em> become <em>foo</em>161- <strong>foo</strong> or <strong>foo</strong> become <strong>foo</strong>162- <a href="B">A</a> becomes <a href="B">A</a></p>163-164-<h2></h2>165-166-<ul><li><p><strong>param</strong>: <em>String</em> str</p></li><li><p><strong>return</strong>: <em>String</em> </p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>167-</td>168-<td class="code">169-<pre><code><span class="variable">exports</span>.<span class="variable">miniMarkdown</span> = <span class="keyword">function</span>(<span class="variable">str</span>){170- <span class="keyword">return</span> <span class="class">String</span>(<span class="variable">str</span>)171- .<span class="variable">replace</span>(<span class="regexp">/(__|\*\*)(.*?)\1/g</span>, <span class="string">'<strong>$2</strong>'</span>)172- .<span class="variable">replace</span>(<span class="regexp">/(_|\*)(.*?)\1/g</span>, <span class="string">'<em>$2</em>'</span>)173- .<span class="variable">replace</span>(<span class="regexp">/\[([^\]]+)\]\(([^)]+)\)/g</span>, <span class="string">'<a href="$2">$1</a>'</span>);174-};</code></pre>175-</td>176-</tr>177-<tr class="code">178-<td class="docs">179-<p>Escape special characters in the given string of html.</p>180-181-<h2></h2>182-183-<ul><li><p><strong>param</strong>: <em>String</em> html</p></li><li><p><strong>return</strong>: <em>String</em> </p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>184-</td>185-<td class="code">186-<pre><code><span class="variable">exports</span>.<span class="variable">htmlEscape</span> = <span class="keyword">function</span>(<span class="variable">html</span>) {187- <span class="keyword">return</span> <span class="class">String</span>(<span class="variable">html</span>)188- .<span class="variable">replace</span>(<span class="regexp">/&/g</span>, <span class="string">'&'</span>)189- .<span class="variable">replace</span>(<span class="regexp">/"/g</span>, <span class="string">'"'</span>)190- .<span class="variable">replace</span>(<span class="regexp">/</g</span>, <span class="string">'<'</span>)191- .<span class="variable">replace</span>(<span class="regexp">/>/g</span>, <span class="string">'>'</span>);192-};</code></pre>193-</td>194-</tr><tr class="filename"><td><h2 id="lib/express/request.js"><a href="#">request</a></h2></td><td>lib/express/request.js</td></tr><tr class="code">195-<td class="docs">196-<p>Module dependencies.197- </p>198-</td>199-<td class="code">200-<pre><code><span class="keyword">var</span> <span class="variable">http</span> = <span class="variable">require</span>(<span class="string">'http'</span>),201- <span class="variable">utils</span> = <span class="variable">require</span>(<span class="string">'./utils'</span>),202- <span class="variable">mime</span> = <span class="variable">require</span>(<span class="string">'connect/utils'</span>).<span class="variable">mime</span>;</code></pre>203-</td>204-</tr>205-<tr class="code">206-<td class="docs">207-<p>Return request header or optional default.</p>208-209-<h2>Examples</h2>210-211-<pre><code>req.header('Content-Type');212-// => "text/plain"213-214-req.header('content-type');215-// => "text/plain"216-217-req.header('Accept');218-// => undefined219-220-req.header('Accept', 'text/html');221-// => "text/html"</code></pre>222-223-<h2></h2>224-225-<ul><li><p><strong>param</strong>: <em>String</em> name</p></li><li><p><strong>param</strong>: <em>String</em> defaultValue</p></li><li><p><strong>return</strong>: <em>String</em> </p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>226-</td>227-<td class="code">228-<pre><code><span class="variable">http</span>.<span class="class">IncomingMessage</span>.<span class="variable">prototype</span>.<span class="variable">header</span> = <span class="keyword">function</span>(<span class="variable">name</span>, <span class="variable">defaultValue</span>){229- <span class="keyword">return</span> <span class="this">this</span>.<span class="variable">headers</span>[<span class="variable">name</span>.<span class="variable">toLowerCase</span>()] || <span class="variable">defaultValue</span>;230-};</code></pre>231-</td>232-</tr>233-<tr class="code">234-<td class="docs">235-<p>Check if the <em>Accept</em> header is present, and includes the given <code>type</code>.</p>236-237-<p>When the <em>Accept</em> header is not present <code>true</code> is returned. Otherwise238-the given <code>type</code> is matched by an exact match, and then subtypes. You239-may pass the subtype such as "html" which is then converted internally240-to "text/html" using the mime lookup table.</p>241-242-<h2>Examples</h2>243-244-<pre><code>// Accept: text/html245-req.accepts('html');246-// => true247-248-// Accept: text/*; application/json249-req.accepts('html');250-req.accepts('text/html');251-req.accepts('text/plain');252-req.accepts('application/json');253-// => true254-255-req.accepts('image/png');256-req.accepts('png');257-// => false</code></pre>258-259-<h2></h2>260-261-<ul><li><p><strong>param</strong>: <em>String</em> type</p></li><li><p><strong>return</strong>: <em>Boolean</em> </p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>262-</td>263-<td class="code">264-<pre><code><span class="variable">http</span>.<span class="class">IncomingMessage</span>.<span class="variable">prototype</span>.<span class="variable">accepts</span> = <span class="keyword">function</span>(<span class="variable">type</span>){265- <span class="keyword">var</span> <span class="variable">accept</span> = <span class="this">this</span>.<span class="variable">header</span>(<span class="string">'Accept'</span>);266- <span class="keyword">if</span> (!<span class="variable">accept</span> || <span class="variable">accept</span> === '*</code></pre>267-</td>268-</tr>269-<tr class="code">270-<td class="docs">271-<p>') {272- return true;273- } else if (type) {274- // Allow "html" vs "text/html" etc275- if (type.indexOf('/') < 0) {276- type = mime.types['.' + type];277- }278- // Check if we have a direct match279- if (accept.indexOf(type) >= 0) {280- return true;281- // Check if we have type/<em>282- } else {283- type = type.split('/')[0] + '/</em>';284- return accept.indexOf(type) >= 0;285- }286- } else {287- return false;288- }289-};</p>290-291-<p>/**292-Return the value of param <code>name</code> when present.</p>293-294-<ul><li>Checks route placeholders, ex: <em>/user/:id</em></li><li>Checks query string params, ex: ?id=12</li><li>Checks urlencoded body params, ex: id=12</li></ul>295-296-<p>To utilize urlencoded request bodies, <code>req.body</code>297-should be an object. This can be done by using298-the <code>connect.bodyDecoder</code> middleware.</p>299-300-<h2></h2>301-302-<ul><li><p><strong>param</strong>: <em>String</em> name</p></li><li><p><strong>return</strong>: <em>String</em> </p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>303-</td>304-<td class="code">305-<pre><code><span class="variable">http</span>.<span class="class">IncomingMessage</span>.<span class="variable">prototype</span>.<span class="variable">param</span> = <span class="keyword">function</span>(<span class="variable">name</span>){306- <span class="comment">// Route params like /user/:id</span>307- <span class="keyword">if</span> (<span class="this">this</span>.<span class="variable">params</span>.<span class="variable">path</span>[<span class="variable">name</span>] !== <span class="variable">undefined</span>) {308- <span class="keyword">return</span> <span class="this">this</span>.<span class="variable">params</span>.<span class="variable">path</span>[<span class="variable">name</span>]; 309- }310- <span class="comment">// Query string params</span>311- <span class="keyword">if</span> (<span class="this">this</span>.<span class="variable">params</span>.<span class="variable">get</span>[<span class="variable">name</span>] !== <span class="variable">undefined</span>) {312- <span class="keyword">return</span> <span class="this">this</span>.<span class="variable">params</span>.<span class="variable">get</span>[<span class="variable">name</span>]; 313- }314- <span class="comment">// Request body params via connect.bodyDecoder</span>315- <span class="keyword">if</span> (<span class="this">this</span>.<span class="variable">body</span> &<span class="variable">amp</span>;&<span class="variable">amp</span>; <span class="this">this</span>.<span class="variable">body</span>[<span class="variable">name</span>] !== <span class="variable">undefined</span>) {316- <span class="keyword">return</span> <span class="this">this</span>.<span class="variable">body</span>[<span class="variable">name</span>];317- }318-};</code></pre>319-</td>320-</tr>321-<tr class="code">322-<td class="docs">323-<p>Queue flash <code>msg</code> of the given <code>type</code>.</p>324-325-<h2>Examples</h2>326-327-<pre><code> req.flash('info', 'email sent');328- req.flash('error', 'email delivery failed');329- req.flash('info', 'email re-sent');330- // => 2331-332- req.flash('info');333- // => ['email sent', 'email re-sent']334-335- req.flash('info');336- // => []337-338- req.flash();339- // => { error: ['email delivery failed'], info: [] }</code></pre>340-341-<h2></h2>342-343-<ul><li><p><strong>param</strong>: <em>String</em> type</p></li><li><p><strong>param</strong>: <em>String</em> msg</p></li><li><p><strong>return</strong>: <em>Array | Object | Number</em> </p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>344-</td>345-<td class="code">346-<pre><code><span class="variable">http</span>.<span class="class">IncomingMessage</span>.<span class="variable">prototype</span>.<span class="variable">flash</span> = <span class="keyword">function</span>(<span class="variable">type</span>, <span class="variable">msg</span>){347- <span class="keyword">var</span> <span class="variable">msgs</span> = <span class="this">this</span>.<span class="variable">session</span>.<span class="variable">flash</span> = <span class="this">this</span>.<span class="variable">session</span>.<span class="variable">flash</span> || {};348- <span class="keyword">if</span> (<span class="variable">type</span> &<span class="variable">amp</span>;&<span class="variable">amp</span>; <span class="variable">msg</span>) {349- <span class="variable">msg</span> = <span class="variable">utils</span>.<span class="variable">miniMarkdown</span>(<span class="variable">utils</span>.<span class="variable">htmlEscape</span>(<span class="variable">msg</span>));350- <span class="keyword">return</span> (<span class="variable">msgs</span>[<span class="variable">type</span>] = <span class="variable">msgs</span>[<span class="variable">type</span>] || []).<span class="variable">push</span>(<span class="variable">msg</span>);351- } <span class="keyword">else</span> <span class="keyword">if</span> (<span class="variable">type</span>) {352- <span class="keyword">var</span> <span class="variable">arr</span> = <span class="variable">msgs</span>[<span class="variable">type</span>];353- <span class="keyword">delete</span> <span class="variable">msgs</span>[<span class="variable">type</span>];354- <span class="keyword">return</span> <span class="variable">arr</span> || [];355- } <span class="keyword">else</span> {356- <span class="this">this</span>.<span class="variable">session</span>.<span class="variable">flash</span> = {};357- <span class="keyword">return</span> <span class="variable">msgs</span>;358- }359-};360-361-<span class="comment">// Callback for isXMLHttpRequest / xhr</span>362-363-<span class="keyword">function</span> <span class="variable">isxhr</span>() {364- <span class="keyword">return</span> <span class="this">this</span>.<span class="variable">header</span>(<span class="string">'X-Requested-With'</span>, <span class="string">''</span>).<span class="variable">toLowerCase</span>() === <span class="string">'xmlhttprequest'</span>;365-}</code></pre>366-</td>367-</tr>368-<tr class="code">369-<td class="docs">370-<p>Check if the request was an <em>XMLHttpRequest</em>.</p>371-372-<h2></h2>373-374-<ul><li><p><strong>return</strong>: <em>Boolean</em> </p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>375-</td>376-<td class="code">377-<pre><code><span class="variable">http</span>.<span class="class">IncomingMessage</span>.<span class="variable">prototype</span>.<span class="variable">__defineGetter__</span>(<span class="string">'isXMLHttpRequest'</span>, <span class="variable">isxhr</span>);378-<span class="variable">http</span>.<span class="class">IncomingMessage</span>.<span class="variable">prototype</span>.<span class="variable">__defineGetter__</span>(<span class="string">'xhr'</span>, <span class="variable">isxhr</span>);</code></pre>379-</td>154 </tr><tr class="filename"><td><h2 id="lib/express/response.js"><a href="#">response</a></h2></td><td>lib/express/response.js</td></tr><tr class="code">155 <td class="docs">156 <p>Module dependencies.157 </p>448 unmodified lines606 <span class="keyword">return</span> <span class="variable">arguments</span>.<span class="variable">callee</span>;607 })(<span class="string">'get'</span>)(<span class="string">'post'</span>)(<span class="string">'put'</span>)(<span class="string">'del'</span>);608 </code></pre>609 </td>610+</tr><tr class="filename"><td><h2 id="lib/express/request.js"><a href="#">request</a></h2></td><td>lib/express/request.js</td></tr><tr class="code">611+<td class="docs">612+<p>Module dependencies.613+ </p>614+</td>615+<td class="code">616+<pre><code><span class="keyword">var</span> <span class="variable">http</span> = <span class="variable">require</span>(<span class="string">'http'</span>),617+ <span class="variable">utils</span> = <span class="variable">require</span>(<span class="string">'./utils'</span>),618+ <span class="variable">mime</span> = <span class="variable">require</span>(<span class="string">'connect/utils'</span>).<span class="variable">mime</span>;</code></pre>619+</td>620+</tr>621+<tr class="code">622+<td class="docs">623+<p>Return request header or optional default.</p>624+625+<h2>Examples</h2>626+627+<pre><code>req.header('Content-Type');628+// => "text/plain"629+630+req.header('content-type');631+// => "text/plain"632+633+req.header('Accept');634+// => undefined635+636+req.header('Accept', 'text/html');637+// => "text/html"</code></pre>638+639+<h2></h2>640+641+<ul><li><p><strong>param</strong>: <em>String</em> name</p></li><li><p><strong>param</strong>: <em>String</em> defaultValue</p></li><li><p><strong>return</strong>: <em>String</em> </p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>642+</td>643+<td class="code">644+<pre><code><span class="variable">http</span>.<span class="class">IncomingMessage</span>.<span class="variable">prototype</span>.<span class="variable">header</span> = <span class="keyword">function</span>(<span class="variable">name</span>, <span class="variable">defaultValue</span>){645+ <span class="keyword">return</span> <span class="this">this</span>.<span class="variable">headers</span>[<span class="variable">name</span>.<span class="variable">toLowerCase</span>()] || <span class="variable">defaultValue</span>;646+};</code></pre>647+</td>648+</tr>649+<tr class="code">650+<td class="docs">651+<p>Check if the <em>Accept</em> header is present, and includes the given <code>type</code>.</p>652+653+<p>When the <em>Accept</em> header is not present <code>true</code> is returned. Otherwise654+the given <code>type</code> is matched by an exact match, and then subtypes. You655+may pass the subtype such as "html" which is then converted internally656+to "text/html" using the mime lookup table.</p>657+658+<h2>Examples</h2>659+660+<pre><code>// Accept: text/html661+req.accepts('html');662+// => true663+664+// Accept: text/*; application/json665+req.accepts('html');666+req.accepts('text/html');667+req.accepts('text/plain');668+req.accepts('application/json');669+// => true670+671+req.accepts('image/png');672+req.accepts('png');673+// => false</code></pre>674+675+<h2></h2>676+677+<ul><li><p><strong>param</strong>: <em>String</em> type</p></li><li><p><strong>return</strong>: <em>Boolean</em> </p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>678+</td>679+<td class="code">680+<pre><code><span class="variable">http</span>.<span class="class">IncomingMessage</span>.<span class="variable">prototype</span>.<span class="variable">accepts</span> = <span class="keyword">function</span>(<span class="variable">type</span>){681+ <span class="keyword">var</span> <span class="variable">accept</span> = <span class="this">this</span>.<span class="variable">header</span>(<span class="string">'Accept'</span>);682+ <span class="keyword">if</span> (!<span class="variable">accept</span> || <span class="variable">accept</span> === '*</code></pre>683+</td>684+</tr>685+<tr class="code">686+<td class="docs">687+<p>') {688+ return true;689+ } else if (type) {690+ // Allow "html" vs "text/html" etc691+ if (type.indexOf('/') < 0) {692+ type = mime.types['.' + type];693+ }694+ // Check if we have a direct match695+ if (accept.indexOf(type) >= 0) {696+ return true;697+ // Check if we have type/<em>698+ } else {699+ type = type.split('/')[0] + '/</em>';700+ return accept.indexOf(type) >= 0;701+ }702+ } else {703+ return false;704+ }705+};</p>706+707+<p>/**708+Return the value of param <code>name</code> when present.</p>709+710+<ul><li>Checks route placeholders, ex: <em>/user/:id</em></li><li>Checks query string params, ex: ?id=12</li><li>Checks urlencoded body params, ex: id=12</li></ul>711+712+<p>To utilize urlencoded request bodies, <code>req.body</code>713+should be an object. This can be done by using714+the <code>connect.bodyDecoder</code> middleware.</p>715+716+<h2></h2>717+718+<ul><li><p><strong>param</strong>: <em>String</em> name</p></li><li><p><strong>return</strong>: <em>String</em> </p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>719+</td>720+<td class="code">721+<pre><code><span class="variable">http</span>.<span class="class">IncomingMessage</span>.<span class="variable">prototype</span>.<span class="variable">param</span> = <span class="keyword">function</span>(<span class="variable">name</span>){722+ <span class="comment">// Route params like /user/:id</span>723+ <span class="keyword">if</span> (<span class="this">this</span>.<span class="variable">params</span>.<span class="variable">path</span>[<span class="variable">name</span>] !== <span class="variable">undefined</span>) {724+ <span class="keyword">return</span> <span class="this">this</span>.<span class="variable">params</span>.<span class="variable">path</span>[<span class="variable">name</span>]; 725+ }726+ <span class="comment">// Query string params</span>727+ <span class="keyword">if</span> (<span class="this">this</span>.<span class="variable">params</span>.<span class="variable">get</span>[<span class="variable">name</span>] !== <span class="variable">undefined</span>) {728+ <span class="keyword">return</span> <span class="this">this</span>.<span class="variable">params</span>.<span class="variable">get</span>[<span class="variable">name</span>]; 729+ }730+ <span class="comment">// Request body params via connect.bodyDecoder</span>731+ <span class="keyword">if</span> (<span class="this">this</span>.<span class="variable">body</span> &<span class="variable">amp</span>;&<span class="variable">amp</span>; <span class="this">this</span>.<span class="variable">body</span>[<span class="variable">name</span>] !== <span class="variable">undefined</span>) {732+ <span class="keyword">return</span> <span class="this">this</span>.<span class="variable">body</span>[<span class="variable">name</span>];733+ }734+};</code></pre>735+</td>736+</tr>737+<tr class="code">738+<td class="docs">739+<p>Queue flash <code>msg</code> of the given <code>type</code>.</p>740+741+<h2>Examples</h2>742+743+<pre><code> req.flash('info', 'email sent');744+ req.flash('error', 'email delivery failed');745+ req.flash('info', 'email re-sent');746+ // => 2747+748+ req.flash('info');749+ // => ['email sent', 'email re-sent']750+751+ req.flash('info');752+ // => []753+754+ req.flash();755+ // => { error: ['email delivery failed'], info: [] }</code></pre>756+757+<h2></h2>758+759+<ul><li><p><strong>param</strong>: <em>String</em> type</p></li><li><p><strong>param</strong>: <em>String</em> msg</p></li><li><p><strong>return</strong>: <em>Array | Object | Number</em> </p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>760+</td>761+<td class="code">762+<pre><code><span class="variable">http</span>.<span class="class">IncomingMessage</span>.<span class="variable">prototype</span>.<span class="variable">flash</span> = <span class="keyword">function</span>(<span class="variable">type</span>, <span class="variable">msg</span>){763+ <span class="keyword">var</span> <span class="variable">msgs</span> = <span class="this">this</span>.<span class="variable">session</span>.<span class="variable">flash</span> = <span class="this">this</span>.<span class="variable">session</span>.<span class="variable">flash</span> || {};764+ <span class="keyword">if</span> (<span class="variable">type</span> &<span class="variable">amp</span>;&<span class="variable">amp</span>; <span class="variable">msg</span>) {765+ <span class="variable">msg</span> = <span class="variable">utils</span>.<span class="variable">miniMarkdown</span>(<span class="variable">utils</span>.<span class="variable">htmlEscape</span>(<span class="variable">msg</span>));766+ <span class="keyword">return</span> (<span class="variable">msgs</span>[<span class="variable">type</span>] = <span class="variable">msgs</span>[<span class="variable">type</span>] || []).<span class="variable">push</span>(<span class="variable">msg</span>);767+ } <span class="keyword">else</span> <span class="keyword">if</span> (<span class="variable">type</span>) {768+ <span class="keyword">var</span> <span class="variable">arr</span> = <span class="variable">msgs</span>[<span class="variable">type</span>];769+ <span class="keyword">delete</span> <span class="variable">msgs</span>[<span class="variable">type</span>];770+ <span class="keyword">return</span> <span class="variable">arr</span> || [];771+ } <span class="keyword">else</span> {772+ <span class="this">this</span>.<span class="variable">session</span>.<span class="variable">flash</span> = {};773+ <span class="keyword">return</span> <span class="variable">msgs</span>;774+ }775+};776+777+<span class="comment">// Callback for isXMLHttpRequest / xhr</span>778+779+<span class="keyword">function</span> <span class="variable">isxhr</span>() {780+ <span class="keyword">return</span> <span class="this">this</span>.<span class="variable">header</span>(<span class="string">'X-Requested-With'</span>, <span class="string">''</span>).<span class="variable">toLowerCase</span>() === <span class="string">'xmlhttprequest'</span>;781+}</code></pre>782+</td>783+</tr>784+<tr class="code">785+<td class="docs">786+<p>Check if the request was an <em>XMLHttpRequest</em>.</p>787+788+<h2></h2>789+790+<ul><li><p><strong>return</strong>: <em>Boolean</em> </p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>791+</td>792+<td class="code">793+<pre><code><span class="variable">http</span>.<span class="class">IncomingMessage</span>.<span class="variable">prototype</span>.<span class="variable">__defineGetter__</span>(<span class="string">'isXMLHttpRequest'</span>, <span class="variable">isxhr</span>);794+<span class="variable">http</span>.<span class="class">IncomingMessage</span>.<span class="variable">prototype</span>.<span class="variable">__defineGetter__</span>(<span class="string">'xhr'</span>, <span class="variable">isxhr</span>);</code></pre>795+</td>796 </tr><tr class="filename"><td><h2 id="lib/express/view.js"><a href="#">view</a></h2></td><td>lib/express/view.js</td></tr><tr class="code">797 <td class="docs">798 <p>Module dependencies.799 </p>210 unmodified lines1010 }1011 };1012 </code></pre>1013 </td>1014+</tr><tr class="filename"><td><h2 id="lib/express/utils.js"><a href="#">utils</a></h2></td><td>lib/express/utils.js</td></tr><tr class="code">1015+<td class="docs">1016+<p>Parse mini markdown implementation.1017+The following conversions are supported,1018+primarily for the "flash" middleware:</p>1019+1020+<p> <em>foo</em> or <em>foo</em> become <em>foo</em>1021+ <strong>foo</strong> or <strong>foo</strong> become <strong>foo</strong>1022+ <a href="B">A</a> becomes <a href="B">A</a></p>1023+1024+<h2></h2>1025+1026+<ul><li><p><strong>param</strong>: <em>String</em> str</p></li><li><p><strong>return</strong>: <em>String</em> </p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>1027+</td>1028+<td class="code">1029+<pre><code><span class="variable">exports</span>.<span class="variable">miniMarkdown</span> = <span class="keyword">function</span>(<span class="variable">str</span>){1030+ <span class="keyword">return</span> <span class="class">String</span>(<span class="variable">str</span>)1031+ .<span class="variable">replace</span>(<span class="regexp">/(__|\*\*)(.*?)\1/g</span>, <span class="string">'<strong>$2</strong>'</span>)1032+ .<span class="variable">replace</span>(<span class="regexp">/(_|\*)(.*?)\1/g</span>, <span class="string">'<em>$2</em>'</span>)1033+ .<span class="variable">replace</span>(<span class="regexp">/\[([^\]]+)\]\(([^)]+)\)/g</span>, <span class="string">'<a href="$2">$1</a>'</span>);1034+};</code></pre>1035+</td>1036+</tr>1037+<tr class="code">1038+<td class="docs">1039+<p>Escape special characters in the given string of html.</p>1040+1041+<h2></h2>1042+1043+<ul><li><p><strong>param</strong>: <em>String</em> html</p></li><li><p><strong>return</strong>: <em>String</em> </p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>1044+</td>1045+<td class="code">1046+<pre><code><span class="variable">exports</span>.<span class="variable">htmlEscape</span> = <span class="keyword">function</span>(<span class="variable">html</span>) {1047+ <span class="keyword">return</span> <span class="class">String</span>(<span class="variable">html</span>)1048+ .<span class="variable">replace</span>(<span class="regexp">/&/g</span>, <span class="string">'&'</span>)1049+ .<span class="variable">replace</span>(<span class="regexp">/"/g</span>, <span class="string">'"'</span>)1050+ .<span class="variable">replace</span>(<span class="regexp">/</g</span>, <span class="string">'<'</span>)1051+ .<span class="variable">replace</span>(<span class="regexp">/>/g</span>, <span class="string">'>'</span>);1052+};</code></pre>1053+</td>1054 </tr> </body>1055 </html></tbody></table>modified:docs/contrib.html+17 added
42 unmodified lines43 border: none !important; }44 45 a {46 font-weight: bold;47+ text-decoration: none;48 color: white;49 -webkit-transition-property: opacity, -webkit-transform, color, background-color, padding, -webkit-box-shadow;50 -webkit-transition-duration: 0.15s;51 -webkit-transition-timing-function: ease-out; }60 unmodified lines112 margin: 0 auto;113 padding-top: 110px;114 width: 550px; }115 116+ #toc {117+ position: fixed;118+ top: 60px;119+ left: 0;120+ margin: 0 0 0 15px;121+ padding: 15px;122+ height: 100%;123+ background: rgba(0,0,0,0.2);124+ border-right: 1px solid rgba(255,255,255,0.05);125+ }126+ #toc li {127+ list-style: none;128+ }129+ #toc li a {130+ font-size: 11px;131+ }132 #menu {133 margin-left: 65px;134 padding: 0;135 padding-bottom: 30px; }84 unmodified linesmodified:docs/executable.html+17 added
42 unmodified lines43 border: none !important; }44 45 a {46 font-weight: bold;47+ text-decoration: none;48 color: white;49 -webkit-transition-property: opacity, -webkit-transform, color, background-color, padding, -webkit-box-shadow;50 -webkit-transition-duration: 0.15s;51 -webkit-transition-timing-function: ease-out; }60 unmodified lines112 margin: 0 auto;113 padding-top: 110px;114 width: 550px; }115 116+ #toc {117+ position: fixed;118+ top: 60px;119+ left: 0;120+ margin: 0 0 0 15px;121+ padding: 15px;122+ height: 100%;123+ background: rgba(0,0,0,0.2);124+ border-right: 1px solid rgba(255,255,255,0.05);125+ }126+ #toc li {127+ list-style: none;128+ }129+ #toc li a {130+ font-size: 11px;131+ }132 #menu {133 margin-left: 65px;134 padding: 0;135 padding-bottom: 30px; }66 unmodified linesmodified:docs/guide.1+12 added-12 removed
248 unmodified lines249 .fi250 .251 .IP "" 0252 .253-.SS "ServerRequest#header(key[, defaultValue])"253+.SS "Request#header(key[, defaultValue])"254 Get the case\-insensitive request header \fIkey\fR, with optional \fIdefaultValue\fR:255 .256 .IP "" 4257 .6 unmodified lines264 .fi265 .266 .IP "" 0267 .268-.SS "ServerRequest#accepts(type)"268+.SS "Request#accepts(type)"269 Check if the \fIAccept\fR header is present, and includes the given \fItype\fR\.270 .271 .P272 When the \fIAccept\fR header is not present \fItrue\fR is returned\. Otherwise the given \fItype\fR is matched by an exact match, and then subtypes\. You may pass the subtype such as \"html\" which is then converted internally to \"text/html\" using the mime lookup table\.20 unmodified lines293 .fi294 .295 .IP "" 0296 .297-.SS "ServerRequest#param(name)"297+.SS "Request#param(name)"298 Return the value of param \fIname\fR when present\.299 .300 .IP "\(bu" 4301 Checks route placeholders, ex: /user/:id8 unmodified lines310 .311 .P312 To utilize urlencoded request bodies, \fIreq\.body\fR should be an object\. This can be done by using the \fIconnect\.bodyDecoder\fR middleware\.313 .314-.SS "ServerRequest#flash(type[, msg])"314+.SS "Request#flash(type[, msg])"315 Queue flash \fImsg\fR of the given \fItype\fR\.316 .317 .IP "" 4318 .16 unmodified lines335 .fi336 .337 .IP "" 0338 .339-.SS "ServerRequest#isXMLHttpRequest"339+.SS "Request#isXMLHttpRequest"340 Also aliased as \fIreq\.xhr\fR, this getter checks the \fIX\-Requested\-With\fR header to see if it was issued by an \fIXMLHttpRequest\fR:341 .342 .IP "" 4343 .5 unmodified lines349 .fi350 .351 .IP "" 0352 .353-.SS "ServerResponse#header(key[, val])"353+.SS "Response#header(key[, val])"354 Get or set the response header \fIkey\fR\.355 .356 .IP "" 4357 .11 unmodified lines369 .fi370 .371 .IP "" 0372 .373-.SS "ServerResponse#contentType(type)"373+.SS "Response#contentType(type)"374 Sets the \fIContent\-Type\fR response header to the given \fItype\fR\.375 .376 .IP "" 4377 .6 unmodified lines384 .fi385 .386 .IP "" 0387 .388-.SS "ServerResponse#attachment([filename])"388+.SS "Response#attachment([filename])"389 Sets the \fIContent\-Disposition\fR response header to \"attachment\", with optional \fIfilename\fR\.390 .391 .IP "" 4392 .4 unmodified lines397 .fi398 .399 .IP "" 0400 .401-.SS "ServerResponse#sendfile(path)"401+.SS "Response#sendfile(path)"402 Used by \fBres\.download()\fR to transfer an arbitrary file\.403 .404 .IP "" 4405 .7 unmodified lines413 .414 .P415 \fBNOTE\fR: this is \fInot\fR a replacement for Connect\'s \fIstaticProvider\fR middleware, nor does it perform any security checks, use with caution when using in a dynamic manor\.416 .417-.SS "ServerResponse#download(file[, filename])"417+.SS "Response#download(file[, filename])"418 Transfer the given \fIfile\fR as an attachment with optional alternative \fIfilename\fR\.419 .420 .IP "" 4421 .19 unmodified lines441 .fi442 .443 .IP "" 0444 .445-.SS "ServerRequest#send(body|status[, headers|status[, status]])"445+.SS "Response#send(body|status[, headers|status[, status]])"446 The \fBres\.send()\fR method is a high level response utility allowing you to pass objects to respond with json, strings for html, arbitrary _Buffer_s or numbers for status code based responses\. The following are all valid uses:447 .448 .IP "" 4449 .12 unmodified lines462 .463 .P464 By default the \fIContent\-Type\fR response header is set, however if explicitly assigned through \fBres\.send()\fR or previously with \fBres\.header()\fR or \fBres\.contentType()\fR it will not be set again\.465 .466-.SS "ServerResponse#redirect(url[, status])"466+.SS "Response#redirect(url[, status])"467 Redirect to the given \fIurl\fR with a default response \fIstatus\fR of 302\.468 .469 .IP "" 4470 .64 unmodified linesmodified:docs/guide.html+51 added-13 removed
42 unmodified lines43 border: none !important; }44 45 a {46 font-weight: bold;47+ text-decoration: none;48 color: white;49 -webkit-transition-property: opacity, -webkit-transform, color, background-color, padding, -webkit-box-shadow;50 -webkit-transition-duration: 0.15s;51 -webkit-transition-timing-function: ease-out; }60 unmodified lines112 margin: 0 auto;113 padding-top: 110px;114 width: 550px; }115 116+ #toc {117+ position: fixed;118+ top: 60px;119+ left: 0;120+ margin: 0 0 0 15px;121+ padding: 15px;122+ height: 100%;123+ background: rgba(0,0,0,0.2);124+ border-right: 1px solid rgba(255,255,255,0.05);125+ }126+ #toc li {127+ list-style: none;128+ }129+ #toc li a {130+ font-size: 11px;131+ }132 #menu {133 margin-left: 65px;134 padding: 0;135 padding-bottom: 30px; }27 unmodified lines163 <img alt='Fork me on GitHub' id='ribbon' src='http://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png' /> 164 </a>165 <div id="header"><strong>Sencha</strong> labs</div>166 <div id="wrapper">150- <div id="container">167+ <div id="container"><ul id="toc">168+<li><a href="#Installation">Installation</a></li>169+<li><a href="#Creating-An-Application">Creating An Application</a></li>170+<li><a href="#Configuration">Configuration</a></li>171+<li><a href="#Settings">Settings</a></li>172+<li><a href="#Routing">Routing</a></li>173+<li><a href="#Passing-Route-Control">Passing Route Control</a></li>174+<li><a href="#Middleware">Middleware</a></li>175+<li><a href="#Request-header-key-defaultValue-">Request#header</a></li>176+<li><a href="#Request-accepts-type-">Request#accepts</a></li>177+<li><a href="#Request-param-name-">Request#param</a></li>178+<li><a href="#Request-flash-type-msg-">Request#flash</a></li>179+<li><a href="#Request-isXMLHttpRequest">Request#isXMLHttpRequest</a></li>180+<li><a href="#Response-header-key-val-">Response#header</a></li>181+<li><a href="#Response-contentType-type-">Response#contentType</a></li>182+<li><a href="#Response-attachment-filename-">Response#attachment</a></li>183+<li><a href="#Response-sendfile-path-">Response#sendfile</a></li>184+<li><a href="#Response-download-file-filename-">Response#download</a></li>185+<li><a href="#Response-send-body-status-headers-status-status-">Response#send</a></li>186+<li><a href="#Response-redirect-url-status-">Response#redirect</a></li>187+<li><a href="#Server-redirect-name-val-">Server#redirect</a></li>188+</ul>189 <a href='http://github.com/visionmedia/express' id='logo'>Express</a> 190 <p id="tagline">191 High performance, high class web development for192 <a href="http://nodejs.org">Node.js</a>175 unmodified lines368 connect.bodyDecoder()369 );370 </code></pre>371 334-<h3 id="ServerRequest-header-key-defaultValue-">ServerRequest#header(key[, defaultValue])</h3>372+<h3 id="Request-header-key-defaultValue-">Request#header(key[, defaultValue])</h3>373 374 <p>Get the case-insensitive request header <em>key</em>, with optional <em>defaultValue</em>:</p>375 376 <pre><code>req.header('Host');377 req.header('host');378 req.header('Accept', '*/*');379 </code></pre>380 343-<h3 id="ServerRequest-accepts-type-">ServerRequest#accepts(type)</h3>381+<h3 id="Request-accepts-type-">Request#accepts(type)</h3>382 383 <p>Check if the <em>Accept</em> header is present, and includes the given <em>type</em>.</p>384 385 <p>When the <em>Accept</em> header is not present <em>true</em> is returned. Otherwise16 unmodified lines402 req.accepts('png');403 // => false404 </code></pre>405 368-<h3 id="ServerRequest-param-name-">ServerRequest#param(name)</h3>406+<h3 id="Request-param-name-">Request#param(name)</h3>407 408 <p>Return the value of param <em>name</em> when present.</p>409 410 <ul>6 unmodified lines417 <p>To utilize urlencoded request bodies, <em>req.body</em>418 should be an object. This can be done by using419 the <em>connect.bodyDecoder</em> middleware.</p>420 383-<h3 id="ServerRequest-flash-type-msg-">ServerRequest#flash(type[, msg])</h3>421+<h3 id="Request-flash-type-msg-">Request#flash(type[, msg])</h3>422 423 <p>Queue flash <em>msg</em> of the given <em>type</em>.</p>424 425 <pre><code>req.flash('info', 'email sent');10 unmodified lines436 req.flash();437 // => { error: ['email delivery failed'], info: [] }438 </code></pre>439 402-<h3 id="ServerRequest-isXMLHttpRequest">ServerRequest#isXMLHttpRequest</h3>440+<h3 id="Request-isXMLHttpRequest">Request#isXMLHttpRequest</h3>441 442 <p>Also aliased as <em>req.xhr</em>, this getter checks the <em>X-Requested-With</em> header443 to see if it was issued by an <em>XMLHttpRequest</em>:</p>444 445 <pre><code>req.xhr446 req.isXMLHttpRequest447 </code></pre>448 411-<h3 id="ServerResponse-header-key-val-">ServerResponse#header(key[, val])</h3>449+<h3 id="Response-header-key-val-">Response#header(key[, val])</h3>450 451 <p>Get or set the response header <em>key</em>.</p>452 453 <pre><code>res.header('Content-Length');5 unmodified lines459 res.header('Content-Length');460 // => 123461 </code></pre>462 425-<h3 id="ServerResponse-contentType-type-">ServerResponse#contentType(type)</h3>463+<h3 id="Response-contentType-type-">Response#contentType(type)</h3>464 465 <p>Sets the <em>Content-Type</em> response header to the given <em>type</em>.</p>466 467 <pre><code> var filename = 'path/to/image.png';468 res.contentType(filename);469 // res.headers['Content-Type'] is now "image/png"470 </code></pre>471 434-<h3 id="ServerResponse-attachment-filename-">ServerResponse#attachment([filename])</h3>472+<h3 id="Response-attachment-filename-">Response#attachment([filename])</h3>473 474 <p>Sets the <em>Content-Disposition</em> response header to "attachment", with optional <em>filename</em>.</p>475 476 <pre><code> res.attachment('path/to/my/image.png');477 </code></pre>478 441-<h3 id="ServerResponse-sendfile-path-">ServerResponse#sendfile(path)</h3>479+<h3 id="Response-sendfile-path-">Response#sendfile(path)</h3>480 481 <p>Used by <code>res.download()</code> to transfer an arbitrary file.</p>482 483 <pre><code>res.sendfile('path/to/my.file');1 unmodified line485 486 <p><strong>NOTE</strong>: this is <em>not</em> a replacement for Connect's <em>staticProvider</em> middleware,487 nor does it perform any security checks, use with caution when using in a dynamic manor.</p>488 451-<h3 id="ServerResponse-download-file-filename-">ServerResponse#download(file[, filename])</h3>489+<h3 id="Response-download-file-filename-">Response#download(file[, filename])</h3>490 491 <p>Transfer the given <em>file</em> as an attachment with optional alternative <em>filename</em>.</p>492 493 <pre><code>res.download('path/to/image.png');5 unmodified lines499 <pre><code>res.attachment(file);500 res.sendfile(file);501 </code></pre>502 465-<h3 id="ServerRequest-send-body-status-headers-status-status-">ServerRequest#send(body|status[, headers|status[, status]])</h3>503+<h3 id="Response-send-body-status-headers-status-status-">Response#send(body|status[, headers|status[, status]])</h3>504 505 <p>The <code>res.send()</code> method is a high level response utility allowing you to pass506 objects to respond with json, strings for html, arbitrary _Buffer_s or numbers for status507 code based responses. The following are all valid uses:</p>9 unmodified lines517 <p>By default the <em>Content-Type</em> response header is set, however if explicitly518 assigned through <code>res.send()</code> or previously with <code>res.header()</code> or <code>res.contentType()</code>519 it will not be set again.</p>520 483-<h3 id="ServerResponse-redirect-url-status-">ServerResponse#redirect(url[, status])</h3>521+<h3 id="Response-redirect-url-status-">Response#redirect(url[, status])</h3>522 523 <p>Redirect to the given <em>url</em> with a default response <em>status</em> of 302.</p>524 525 <pre><code>res.redirect('/', 301);42 unmodified linesmodified:docs/guide.md+12 added-12 removed
153 unmodified lines154 connect.logger(),155 connect.bodyDecoder()156 );157 158-### ServerRequest#header(key[, defaultValue])158+### Request#header(key[, defaultValue])159 160 Get the case-insensitive request header _key_, with optional _defaultValue_:161 162 req.header('Host');163 req.header('host');164 req.header('Accept', '*/*');165 166-### ServerRequest#accepts(type)166+### Request#accepts(type)167 168 Check if the _Accept_ header is present, and includes the given _type_.169 170 When the _Accept_ header is not present _true_ is returned. Otherwise15 unmodified lines186 req.accepts('image/png');187 req.accepts('png');188 // => false189 190-### ServerRequest#param(name)190+### Request#param(name)191 192 Return the value of param _name_ when present.193 194 - Checks route placeholders, ex: /user/:id3 unmodified lines198 To utilize urlencoded request bodies, _req.body_199 should be an object. This can be done by using200 the _connect.bodyDecoder_ middleware.201 202-### ServerRequest#flash(type[, msg])202+### Request#flash(type[, msg])203 204 Queue flash _msg_ of the given _type_.205 206 req.flash('info', 'email sent');9 unmodified lines216 217 req.flash();218 // => { error: ['email delivery failed'], info: [] }219 220-### ServerRequest#isXMLHttpRequest220+### Request#isXMLHttpRequest221 222 Also aliased as _req.xhr_, this getter checks the _X-Requested-With_ header223 to see if it was issued by an _XMLHttpRequest_:224 225 req.xhr226 req.isXMLHttpRequest227 228-### ServerResponse#header(key[, val])228+### Response#header(key[, val])229 230 Get or set the response header _key_.231 232 res.header('Content-Length');4 unmodified lines237 238 res.header('Content-Length');239 // => 123240 241-### ServerResponse#contentType(type)241+### Response#contentType(type)242 243 Sets the _Content-Type_ response header to the given _type_.244 245 var filename = 'path/to/image.png';246 res.contentType(filename);247 // res.headers['Content-Type'] is now "image/png"248 249-### ServerResponse#attachment([filename])249+### Response#attachment([filename])250 251 Sets the _Content-Disposition_ response header to "attachment", with optional _filename_.252 253 res.attachment('path/to/my/image.png');254 255-### ServerResponse#sendfile(path)255+### Response#sendfile(path)256 257 Used by `res.download()` to transfer an arbitrary file. 258 259 res.sendfile('path/to/my.file');260 261 **NOTE**: this is _not_ a replacement for Connect's _staticProvider_ middleware,262 nor does it perform any security checks, use with caution when using in a dynamic manor.263 264-### ServerResponse#download(file[, filename])264+### Response#download(file[, filename])265 266 Transfer the given _file_ as an attachment with optional alternative _filename_.267 268 res.download('path/to/image.png');3 unmodified lines272 273 res.attachment(file);274 res.sendfile(file);275 276-### ServerRequest#send(body|status[, headers|status[, status]])276+### Response#send(body|status[, headers|status[, status]])277 278 The `res.send()` method is a high level response utility allowing you to pass279 objects to respond with json, strings for html, arbitrary _Buffer_s or numbers for status280 code based responses. The following are all valid uses:8 unmodified lines289 By default the _Content-Type_ response header is set, however if explicitly290 assigned through `res.send()` or previously with `res.header()` or `res.contentType()`291 it will not be set again.292 293-### ServerResponse#redirect(url[, status])293+### Response#redirect(url[, status])294 295 Redirect to the given _url_ with a default response _status_ of 302.296 297 res.redirect('/', 301);32 unmodified linesmodified:docs/index.html+17 added
42 unmodified lines43 border: none !important; }44 45 a {46 font-weight: bold;47+ text-decoration: none;48 color: white;49 -webkit-transition-property: opacity, -webkit-transform, color, background-color, padding, -webkit-box-shadow;50 -webkit-transition-duration: 0.15s;51 -webkit-transition-timing-function: ease-out; }60 unmodified lines112 margin: 0 auto;113 padding-top: 110px;114 width: 550px; }115 116+ #toc {117+ position: fixed;118+ top: 60px;119+ left: 0;120+ margin: 0 0 0 15px;121+ padding: 15px;122+ height: 100%;123+ background: rgba(0,0,0,0.2);124+ border-right: 1px solid rgba(255,255,255,0.05);125+ }126+ #toc li {127+ list-style: none;128+ }129+ #toc li a {130+ font-size: 11px;131+ }132 #menu {133 margin-left: 65px;134 padding: 0;135 padding-bottom: 30px; }92 unmodified linesmodified:docs/migrate.html+17 added
42 unmodified lines43 border: none !important; }44 45 a {46 font-weight: bold;47+ text-decoration: none;48 color: white;49 -webkit-transition-property: opacity, -webkit-transform, color, background-color, padding, -webkit-box-shadow;50 -webkit-transition-duration: 0.15s;51 -webkit-transition-timing-function: ease-out; }60 unmodified lines112 margin: 0 auto;113 padding-top: 110px;114 width: 550px; }115 116+ #toc {117+ position: fixed;118+ top: 60px;119+ left: 0;120+ margin: 0 0 0 15px;121+ padding: 15px;122+ height: 100%;123+ background: rgba(0,0,0,0.2);124+ border-right: 1px solid rgba(255,255,255,0.05);125+ }126+ #toc li {127+ list-style: none;128+ }129+ #toc li a {130+ font-size: 11px;131+ }132 #menu {133 margin-left: 65px;134 padding: 0;135 padding-bottom: 30px; }262 unmodified linesadded:support/toc.js+21 added
1+#!/usr/bin/env node2+3+var fs = require('fs'),4+ file = process.argv[2];5+6+if (file) {7+ var js = fs.readFileSync(file, 'utf8'),8+ headers = js.match(/<h3 id="(.*?)">(.*?)<\/h3>/g),9+ toc = ['<ul id="toc">'];10+ if (js.indexOf('id="toc"') < 0) {11+ headers.forEach(function(header){12+ var captures = header.match(/id="(.*?)">(.*?)</),13+ id = captures[1],14+ title = captures[2].replace(/\(.*?\)/, '');15+ toc.push('<li><a href="#' + id + '">' + title + '</a></li>');16+ });17+ toc.push('</ul>');18+ js = js.replace('<div id="container">', '<div id="container">' + toc.join('\n'));19+ fs.writeFileSync(file, js);20+ }21+}modified:.pomo-5 removed
21 unmodified lines22 - !ruby/object:Pomo::Task 23 complete: false24 description: 25 length: 2526- name: design mode with browser reloading27-- !ruby/object:Pomo::Task 28- complete: false29- description: 30- length: 2526 name: generated TOC for guidemodified:Makefile+4 added-2 removed
45 unmodified lines46 test-cov:47 @TESTFLAGS=--cov $(MAKE) test48 49 docs: docs/api.html $(MANPAGES) $(HTMLDOCS)50+ @ echo "... generating TOC"51+ @./support/toc.js docs/guide.html52 53 docs/api.html: lib/express/*.js54 dox --title Express \55 --desc "High performance web framework for [node](http://nodejs.org)." \56 $(shell find lib/express/* -type f) > $@57 58 %.1: %.md59 @echo "... $< -> $@"58- @ronn -r --pipe $< > $@ &60+ @ronn -r --pipe $< > $@61 62 %.html: %.md63 @echo "... $< -> $@"64 @ronn -5 --pipe --fragment $< \65 | cat docs/layout/head.html - docs/layout/foot.html \66 | sed 's/NAME/Express/g' \65- > $@ &67+ > $@68 69 docclean:70 rm -f docs/*.{1,html}71 1 unmodified line