Fixed banner
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 · parent e29868c · Browse files · 7 files·+243 added−237 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
7 files+243 added−237 removed
- other:+243 added−237 removed
Provenance
- Commit
2fda5c7- Tree
f8ba73c- Author
Tj Holowaychuk <tj@vision-media.ca>- Committer
Tj Holowaychuk <tj@vision-media.ca>- Parent
e29868c
7 files changed+243 added−237 removed
modified:docs/layout/head.html+7 added-2 removed
4 unmodified lines567899101112131498 unmodified lines11311411511611611711811912012128 unmodified lines1501511521531541551561571581591601611624 unmodified lines #header { position: absolute; top: 10px; left: 0; padding: 12px 40px; padding: 12px 0; text-indent: 40px; width: 100%; border-top: 1px solid rgba(0,0,0,0.7); border-bottom: 1px solid rgba(0,0,0,0.7); background: rgba(255,255,255,0.1) url(http://www.sencha.com/favicon.ico) no-repeat 15px 50%;98 unmodified lines padding-top: 110px; width: 550px; }
#menu { margin-left: 125px; margin-left: 130px; padding: 0; padding-bottom: 30px; } #menu li { display: inline;28 unmodified lines <div id="header"><strong>Sencha</strong> labs</div> <div id="wrapper"> <div id="container"> <a href='http://github.com/visionmedia/express' id='logo'>Express</a> <p id="tagline"> High performance, high class web development for <a href="http://nodejs.org">Node.js</a> </p> <ul id="menu"> <li><a href="index.html">Home</a></li> <li><a href="guide.html">Guide</a></li> <li><a href="migrate.html">1.x Migration</a></li> </ul>modified:docs/api.html+215 added-215 removed
183 unmodified lines184 <span class="variable">require</span>(<span class="string">'./request'</span>);185 <span class="variable">require</span>(<span class="string">'./response'</span>);186 </code></pre>187 </td>188+</tr><tr class="filename"><td><h2 id="lib/express/response.js">response</h2></td><td>lib/express/response.js</td></tr><tr class="code">189+<td class="docs">190+<p>Module dependencies.</p>191+</td>192+<td class="code">193+<pre><code><span class="keyword">var</span> <span class="variable">http</span> = <span class="variable">require</span>(<span class="string">'http'</span>),194+ <span class="variable">path</span> = <span class="variable">require</span>(<span class="string">'path'</span>),195+ <span class="variable">utils</span> = <span class="variable">require</span>(<span class="string">'connect/utils'</span>),196+ <span class="variable">mime</span> = <span class="variable">require</span>(<span class="string">'connect/utils'</span>).<span class="variable">mime</span>,197+ <span class="class">Buffer</span> = <span class="variable">require</span>(<span class="string">'buffer'</span>).<span class="class">Buffer</span>;</code></pre>198+</td>199+</tr>200+<tr class="code">201+<td class="docs">202+<p>Send a response with the given <code>body</code> and optional <code>headers</code> and <code>status</code> code.</p>203+204+<h2>Examples</h2>205+206+<pre><code>res.send(new Buffer('wahoo'));207+res.send({ some: 'json' });208+res.send('<p>some html</p>');209+res.send('Sorry, cant find that', 404);210+res.send('text', { 'Content-Type': 'text/plain' }, 201);211+res.send(404);212+</code></pre>213+214+<h2></h2>215+216+<ul>217+<li><p><strong>param</strong>: <em>String | Object | Number | Buffer</em> body or status</p></li>218+<li><p><strong>param</strong>: <em>Object | Number</em> headers or status</p></li>219+<li><p><strong>param</strong>: <em>Number</em> status</p></li>220+<li><p><strong>return</strong>: <em>ServerResponse</em></p></li>221+<li><p><strong>api</strong>: <em>public</em></p></li>222+</ul>223+224+</td>225+<td class="code">226+<pre><code><span class="variable">http</span>.<span class="class">ServerResponse</span>.<span class="variable">prototype</span>.<span class="variable">send</span> = <span class="keyword">function</span>(<span class="variable">body</span>, <span class="variable">headers</span>, <span class="variable">status</span>){227+ <span class="comment">// Allow status as second arg</span>228+ <span class="keyword">if</span> (<span class="keyword">typeof</span> <span class="variable">headers</span> === <span class="string">'number'</span>) {229+ <span class="variable">status</span> = <span class="variable">headers</span>,230+ <span class="variable">headers</span> = <span class="keyword">null</span>;231+ }232+233+ <span class="comment">// Defaults</span>234+ <span class="variable">status</span> = <span class="variable">status</span> || <span class="number integer">200</span>;235+ <span class="variable">headers</span> = <span class="variable">headers</span> || {};236+237+ <span class="comment">// Determine content type</span>238+ <span class="keyword">switch</span> (<span class="keyword">typeof</span> <span class="variable">body</span>) {239+ <span class="keyword">case</span> <span class="string">'number'</span>:240+ <span class="keyword">if</span> (!<span class="this">this</span>.<span class="variable">headers</span>[<span class="string">'Content-Type'</span>]) {241+ <span class="this">this</span>.<span class="variable">contentType</span>(<span class="string">'.txt'</span>);242+ }243+ <span class="variable">body</span> = <span class="variable">http</span>.<span class="class">STATUS_CODES</span>[<span class="variable">status</span> = <span class="variable">body</span>];244+ <span class="keyword">break</span>;245+ <span class="keyword">case</span> <span class="string">'string'</span>:246+ <span class="keyword">if</span> (!<span class="this">this</span>.<span class="variable">headers</span>[<span class="string">'Content-Type'</span>]) {247+ <span class="this">this</span>.<span class="variable">contentType</span>(<span class="string">'.html'</span>);248+ }249+ <span class="keyword">break</span>;250+ <span class="keyword">case</span> <span class="string">'object'</span>:251+ <span class="keyword">if</span> (!(<span class="variable">body</span> <span class="variable">instanceof</span> <span class="class">Buffer</span>)) {252+ <span class="keyword">if</span> (!<span class="this">this</span>.<span class="variable">headers</span>[<span class="string">'Content-Type'</span>]) {253+ <span class="this">this</span>.<span class="variable">contentType</span>(<span class="string">'.json'</span>);254+ }255+ <span class="variable">body</span> = <span class="class">JSON</span>.<span class="variable">stringify</span>(<span class="variable">body</span>);256+ }257+ <span class="keyword">break</span>;258+ }259+260+ <span class="comment">// Populate Content-Length</span>261+ <span class="keyword">if</span> (!<span class="this">this</span>.<span class="variable">headers</span>[<span class="string">'Content-Length'</span>]) {262+ <span class="this">this</span>.<span class="variable">header</span>(<span class="string">'Content-Length'</span>, <span class="variable">body</span> <span class="variable">instanceof</span> <span class="class">Buffer</span>263+ ? <span class="variable">body</span>.<span class="variable">length</span>264+ : <span class="class">Buffer</span>.<span class="variable">byteLength</span>(<span class="variable">body</span>));265+ }266+267+ <span class="comment">// Merge headers passed</span>268+ <span class="variable">utils</span>.<span class="variable">merge</span>(<span class="this">this</span>.<span class="variable">headers</span>, <span class="variable">headers</span>);269+270+ <span class="comment">// Respond</span>271+ <span class="this">this</span>.<span class="variable">writeHead</span>(<span class="variable">status</span>, <span class="this">this</span>.<span class="variable">headers</span>);272+ <span class="this">this</span>.<span class="variable">end</span>(<span class="variable">body</span>);273+};</code></pre>274+</td>275+</tr>276+<tr class="code">277+<td class="docs">278+<p>Set <em>Content-Type</em> response header passed through <code>mime.type()</code>.</p>279+280+<h2>Examples</h2>281+282+<pre><code>var filename = 'path/to/image.png';283+res.contentType(filename);284+// res.headers['Content-Type'] is now "image/png"285+</code></pre>286+287+<h2></h2>288+289+<ul>290+<li><p><strong>param</strong>: <em>String</em> type</p></li>291+<li><p><strong>return</strong>: <em>String</em> the resolved mime type</p></li>292+<li><p><strong>api</strong>: <em>public</em></p></li>293+</ul>294+295+</td>296+<td class="code">297+<pre><code><span class="variable">http</span>.<span class="class">ServerResponse</span>.<span class="variable">prototype</span>.<span class="variable">contentType</span> = <span class="keyword">function</span>(<span class="variable">type</span>){298+ <span class="keyword">return</span> <span class="this">this</span>.<span class="variable">header</span>(<span class="string">'Content-Type'</span>, <span class="variable">mime</span>.<span class="variable">type</span>(<span class="variable">type</span>));299+};</code></pre>300+</td>301+</tr>302+<tr class="code">303+<td class="docs">304+<p>Set <em>Content-Disposition</em> header to <em>attachment</em> with optional <code>filename</code>.</p>305+306+<h2></h2>307+308+<ul>309+<li><p><strong>param</strong>: <em>String</em> filename</p></li>310+<li><p><strong>return</strong>: <em>ServerResponse</em></p></li>311+<li><p><strong>api</strong>: <em>public</em></p></li>312+</ul>313+314+</td>315+<td class="code">316+<pre><code><span class="variable">http</span>.<span class="class">ServerResponse</span>.<span class="variable">prototype</span>.<span class="variable">attachment</span> = <span class="keyword">function</span>(<span class="variable">filename</span>){317+ <span class="this">this</span>.<span class="variable">header</span>(<span class="string">'Content-Disposition'</span>, <span class="variable">filename</span>318+ ? <span class="string">'attachment; filename="'</span> + <span class="variable">path</span>.<span class="variable">basename</span>(<span class="variable">filename</span>) + <span class="string">'"'</span>319+ : <span class="string">'attachment'</span>);320+ <span class="keyword">return</span> <span class="this">this</span>;321+};</code></pre>322+</td>323+</tr>324+<tr class="code">325+<td class="docs">326+<p>Set or get response header <code>name</code> with optional <code>val</code>.</p>327+328+<h2></h2>329+330+<ul>331+<li><p><strong>param</strong>: <em>String</em> name</p></li>332+<li><p><strong>param</strong>: <em>String</em> val</p></li>333+<li><p><strong>return</strong>: <em>String</em></p></li>334+<li><p><strong>api</strong>: <em>public</em></p></li>335+</ul>336+337+</td>338+<td class="code">339+<pre><code><span class="variable">http</span>.<span class="class">ServerResponse</span>.<span class="variable">prototype</span>.<span class="variable">header</span> = <span class="keyword">function</span>(<span class="variable">name</span>, <span class="variable">val</span>){340+ <span class="keyword">return</span> <span class="variable">val</span> === <span class="variable">undefined</span>341+ ? <span class="this">this</span>.<span class="variable">headers</span>[<span class="variable">name</span>]342+ : <span class="this">this</span>.<span class="variable">headers</span>[<span class="variable">name</span>] = <span class="variable">val</span>;343+};</code></pre>344+</td>345 </tr><tr class="filename"><td><h2 id="lib/express/request.js">request</h2></td><td>lib/express/request.js</td></tr><tr class="code">346 <td class="docs">347 <p>Module dependencies.</p>348 </td>214 unmodified lines563 <td class="code">564 <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>);565 <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>566 </td>410-</tr><tr class="filename"><td><h2 id="lib/express/response.js">response</h2></td><td>lib/express/response.js</td></tr><tr class="code">411-<td class="docs">412-<p>Module dependencies.</p>413-</td>414-<td class="code">415-<pre><code><span class="keyword">var</span> <span class="variable">http</span> = <span class="variable">require</span>(<span class="string">'http'</span>),416- <span class="variable">path</span> = <span class="variable">require</span>(<span class="string">'path'</span>),417- <span class="variable">utils</span> = <span class="variable">require</span>(<span class="string">'connect/utils'</span>),418- <span class="variable">mime</span> = <span class="variable">require</span>(<span class="string">'connect/utils'</span>).<span class="variable">mime</span>,419- <span class="class">Buffer</span> = <span class="variable">require</span>(<span class="string">'buffer'</span>).<span class="class">Buffer</span>;</code></pre>420-</td>421-</tr>422-<tr class="code">423-<td class="docs">424-<p>Send a response with the given <code>body</code> and optional <code>headers</code> and <code>status</code> code.</p>425-426-<h2>Examples</h2>427-428-<pre><code>res.send(new Buffer('wahoo'));429-res.send({ some: 'json' });430-res.send('<p>some html</p>');431-res.send('Sorry, cant find that', 404);432-res.send('text', { 'Content-Type': 'text/plain' }, 201);433-res.send(404);434-</code></pre>435-436-<h2></h2>437-438-<ul>439-<li><p><strong>param</strong>: <em>String | Object | Number | Buffer</em> body or status</p></li>440-<li><p><strong>param</strong>: <em>Object | Number</em> headers or status</p></li>441-<li><p><strong>param</strong>: <em>Number</em> status</p></li>442-<li><p><strong>return</strong>: <em>ServerResponse</em></p></li>443-<li><p><strong>api</strong>: <em>public</em></p></li>444-</ul>445-446-</td>447-<td class="code">448-<pre><code><span class="variable">http</span>.<span class="class">ServerResponse</span>.<span class="variable">prototype</span>.<span class="variable">send</span> = <span class="keyword">function</span>(<span class="variable">body</span>, <span class="variable">headers</span>, <span class="variable">status</span>){449- <span class="comment">// Allow status as second arg</span>450- <span class="keyword">if</span> (<span class="keyword">typeof</span> <span class="variable">headers</span> === <span class="string">'number'</span>) {451- <span class="variable">status</span> = <span class="variable">headers</span>,452- <span class="variable">headers</span> = <span class="keyword">null</span>;453- }454-455- <span class="comment">// Defaults</span>456- <span class="variable">status</span> = <span class="variable">status</span> || <span class="number integer">200</span>;457- <span class="variable">headers</span> = <span class="variable">headers</span> || {};458-459- <span class="comment">// Determine content type</span>460- <span class="keyword">switch</span> (<span class="keyword">typeof</span> <span class="variable">body</span>) {461- <span class="keyword">case</span> <span class="string">'number'</span>:462- <span class="keyword">if</span> (!<span class="this">this</span>.<span class="variable">headers</span>[<span class="string">'Content-Type'</span>]) {463- <span class="this">this</span>.<span class="variable">contentType</span>(<span class="string">'.txt'</span>);464- }465- <span class="variable">body</span> = <span class="variable">http</span>.<span class="class">STATUS_CODES</span>[<span class="variable">status</span> = <span class="variable">body</span>];466- <span class="keyword">break</span>;467- <span class="keyword">case</span> <span class="string">'string'</span>:468- <span class="keyword">if</span> (!<span class="this">this</span>.<span class="variable">headers</span>[<span class="string">'Content-Type'</span>]) {469- <span class="this">this</span>.<span class="variable">contentType</span>(<span class="string">'.html'</span>);470- }471- <span class="keyword">break</span>;472- <span class="keyword">case</span> <span class="string">'object'</span>:473- <span class="keyword">if</span> (!(<span class="variable">body</span> <span class="variable">instanceof</span> <span class="class">Buffer</span>)) {474- <span class="keyword">if</span> (!<span class="this">this</span>.<span class="variable">headers</span>[<span class="string">'Content-Type'</span>]) {475- <span class="this">this</span>.<span class="variable">contentType</span>(<span class="string">'.json'</span>);476- }477- <span class="variable">body</span> = <span class="class">JSON</span>.<span class="variable">stringify</span>(<span class="variable">body</span>);478- }479- <span class="keyword">break</span>;480- }481-482- <span class="comment">// Populate Content-Length</span>483- <span class="keyword">if</span> (!<span class="this">this</span>.<span class="variable">headers</span>[<span class="string">'Content-Length'</span>]) {484- <span class="this">this</span>.<span class="variable">header</span>(<span class="string">'Content-Length'</span>, <span class="variable">body</span> <span class="variable">instanceof</span> <span class="class">Buffer</span>485- ? <span class="variable">body</span>.<span class="variable">length</span>486- : <span class="class">Buffer</span>.<span class="variable">byteLength</span>(<span class="variable">body</span>));487- }488-489- <span class="comment">// Merge headers passed</span>490- <span class="variable">utils</span>.<span class="variable">merge</span>(<span class="this">this</span>.<span class="variable">headers</span>, <span class="variable">headers</span>);491-492- <span class="comment">// Respond</span>493- <span class="this">this</span>.<span class="variable">writeHead</span>(<span class="variable">status</span>, <span class="this">this</span>.<span class="variable">headers</span>);494- <span class="this">this</span>.<span class="variable">end</span>(<span class="variable">body</span>);495-};</code></pre>496-</td>497-</tr>498-<tr class="code">499-<td class="docs">500-<p>Set <em>Content-Type</em> response header passed through <code>mime.type()</code>.</p>501-502-<h2>Examples</h2>503-504-<pre><code>var filename = 'path/to/image.png';505-res.contentType(filename);506-// res.headers['Content-Type'] is now "image/png"507-</code></pre>508-509-<h2></h2>510-511-<ul>512-<li><p><strong>param</strong>: <em>String</em> type</p></li>513-<li><p><strong>return</strong>: <em>String</em> the resolved mime type</p></li>514-<li><p><strong>api</strong>: <em>public</em></p></li>515-</ul>516-517-</td>518-<td class="code">519-<pre><code><span class="variable">http</span>.<span class="class">ServerResponse</span>.<span class="variable">prototype</span>.<span class="variable">contentType</span> = <span class="keyword">function</span>(<span class="variable">type</span>){520- <span class="keyword">return</span> <span class="this">this</span>.<span class="variable">header</span>(<span class="string">'Content-Type'</span>, <span class="variable">mime</span>.<span class="variable">type</span>(<span class="variable">type</span>));521-};</code></pre>522-</td>523-</tr>524-<tr class="code">525-<td class="docs">526-<p>Set <em>Content-Disposition</em> header to <em>attachment</em> with optional <code>filename</code>.</p>527-528-<h2></h2>529-530-<ul>531-<li><p><strong>param</strong>: <em>String</em> filename</p></li>532-<li><p><strong>return</strong>: <em>ServerResponse</em></p></li>533-<li><p><strong>api</strong>: <em>public</em></p></li>534-</ul>535-536-</td>537-<td class="code">538-<pre><code><span class="variable">http</span>.<span class="class">ServerResponse</span>.<span class="variable">prototype</span>.<span class="variable">attachment</span> = <span class="keyword">function</span>(<span class="variable">filename</span>){539- <span class="this">this</span>.<span class="variable">header</span>(<span class="string">'Content-Disposition'</span>, <span class="variable">filename</span>540- ? <span class="string">'attachment; filename="'</span> + <span class="variable">path</span>.<span class="variable">basename</span>(<span class="variable">filename</span>) + <span class="string">'"'</span>541- : <span class="string">'attachment'</span>);542- <span class="keyword">return</span> <span class="this">this</span>;543-};</code></pre>544-</td>545-</tr>546-<tr class="code">547-<td class="docs">548-<p>Set or get response header <code>name</code> with optional <code>val</code>.</p>549-550-<h2></h2>551-552-<ul>553-<li><p><strong>param</strong>: <em>String</em> name</p></li>554-<li><p><strong>param</strong>: <em>String</em> val</p></li>555-<li><p><strong>return</strong>: <em>String</em></p></li>556-<li><p><strong>api</strong>: <em>public</em></p></li>557-</ul>558-559-</td>560-<td class="code">561-<pre><code><span class="variable">http</span>.<span class="class">ServerResponse</span>.<span class="variable">prototype</span>.<span class="variable">header</span> = <span class="keyword">function</span>(<span class="variable">name</span>, <span class="variable">val</span>){562- <span class="keyword">return</span> <span class="variable">val</span> === <span class="variable">undefined</span>563- ? <span class="this">this</span>.<span class="variable">headers</span>[<span class="variable">name</span>]564- : <span class="this">this</span>.<span class="variable">headers</span>[<span class="variable">name</span>] = <span class="variable">val</span>;565-};</code></pre>566-</td>567 </tr><tr class="filename"><td><h2 id="lib/express/server.js">server</h2></td><td>lib/express/server.js</td></tr><tr class="code">568 <td class="docs">569 <p>Module dependencies.</p>570 </td>50 unmodified lines621 </td>622 </tr>623 <tr class="code">624 <td class="docs">625-<p>Inherit from <code>connect.Server</code>.</p>625+<p>Inherit from <code>connect.Server</code>.</p>626 </td>627 <td class="code">628 <pre><code><span class="variable">sys</span>.<span class="variable">inherits</span>(<span class="class">Server</span>, <span class="variable">connect</span>.<span class="class">Server</span>);</code></pre>629 </td>87 unmodified lines717 <li><p><strong>param</strong>: <em>String</em> setting</p></li>718 <li><p><strong>return</strong>: <em>Server</em> for chaining</p></li>719 <li><p><strong>api</strong>: <em>public</em></p></li>720 </ul>721-[Q721+ZQ722 </td>723 <td class="code">724 <pre><code><span class="class">Server</span>.<span class="variable">prototype</span>.<span class="variable">enable</span> = <span class="keyword">function</span>(<span class="variable">setting</span>){725 <span class="keyword">return</span> <span class="this">this</span>.<span class="variable">set</span>(<span class="variable">setting</span>, <span class="variable">true</span>);10 unmodified lines736 <li><p><strong>param</strong>: <em>String</em> setting</p></li>737 <li><p><strong>return</strong>: <em>Server</em> for chaining</p></li>738 <li><p><strong>api</strong>: <em>public</em></p></li>739 </ul>740-740+P741 </td>742 <td class="code">743 <pre><code><span class="class">Server</span>.<span class="variable">prototype</span>.<span class="variable">disable</span> = <span class="keyword">function</span>(<span class="variable">setting</span>){744 <span class="keyword">return</span> <span class="this">this</span>.<span class="variable">set</span>(<span class="variable">setting</span>, <span class="variable">false</span>);10 unmodified lines755 <li><p><strong>param</strong>: <em>String</em> setting</p></li>756 <li><p><strong>return</strong>: <em>Server</em> for chaining</p></li>757 <li><p><strong>api</strong>: <em>public</em></p></li>758 </ul>759-759+P760 </td>761 <td class="code">762 <pre><code><span class="class">Server</span>.<span class="variable">prototype</span>.<span class="variable">configure</span> = <span class="keyword">function</span>(<span class="variable">env</span>, <span class="variable">fn</span>){763 <span class="keyword">if</span> (<span class="keyword">typeof</span> <span class="variable">env</span> === <span class="string">'function'</span>) <span class="variable">fn</span> = <span class="variable">env</span>, <span class="variable">env</span> = <span class="string">'any'</span>;11 unmodified lines775 <span class="keyword">return</span> <span class="variable">arguments</span>.<span class="variable">callee</span>;776 })(<span class="string">'get'</span>)(<span class="string">'post'</span>)(<span class="string">'put'</span>)(<span class="string">'del'</span>);777 </code></pre>778 </td>779-</tr><tr class="filename"><td><h2 id="lib/express/utils.js">utils</h2></td><td>lib/express/utils.js</td></tr><tr class="code">780-<td class="docs">781-<p>Parse mini markdown implementation.782-The following conversions are supported,783-primarily for the “flash” middleware:</p>784-785-<p> <em>foo</em> or <em>foo</em> become <em>foo</em>786- <strong>foo</strong> or <strong>foo</strong> become <strong>foo</strong>787- <a href="B">A</a> becomes <a href="B">A</a></p>788-789-<h2></h2>790-791-<ul>792-<li><p><strong>param</strong>: <em>String</em> str</p></li>793-<li><p><strong>return</strong>: <em>String</em></p></li>794-<li><p><strong>api</strong>: <em>public</em></p></li>795-</ul>796-797-</td>798-<td class="code">799-<pre><code><span class="variable">exports</span>.<span class="variable">miniMarkdown</span> = <span class="keyword">function</span>(<span class="variable">str</span>){800- <span class="keyword">return</span> <span class="class">String</span>(<span class="variable">str</span>)801- .<span class="variable">replace</span>(<span class="regexp">/(__|\*\*)(.*?)\1/g</span>, <span class="string">'<strong>$2</strong>'</span>)802- .<span class="variable">replace</span>(<span class="regexp">/(_|\*)(.*?)\1/g</span>, <span class="string">'<em>$2</em>'</span>)803- .<span class="variable">replace</span>(<span class="regexp">/\[([^\]]+)\]\(([^)]+)\)/g</span>, <span class="string">'<a href="$2">$1</a>'</span>);804-};</code></pre>805-</td>806-</tr>807-<tr class="code">808-<td class="docs">809-<p>Escape special characters in the given string of html.</p>810-811-<h2></h2>812-813-<ul>814-<li><p><strong>param</strong>: <em>String</em> html</p></li>815-<li><p><strong>return</strong>: <em>String</em></p></li>816-<li><p><strong>api</strong>: <em>public</em></p></li>817-</ul>818-819-</td>820-<td class="code">821-<pre><code><span class="variable">exports</span>.<span class="variable">htmlEscape</span> = <span class="keyword">function</span>(<span class="variable">html</span>) {822- <span class="keyword">return</span> <span class="class">String</span>(<span class="variable">html</span>)823- .<span class="variable">replace</span>(<span class="regexp">/&/g</span>, <span class="string">'&'</span>)824- .<span class="variable">replace</span>(<span class="regexp">/"/g</span>, <span class="string">'"'</span>)825- .<span class="variable">replace</span>(<span class="regexp">/</g</span>, <span class="string">'<'</span>)826- .<span class="variable">replace</span>(<span class="regexp">/>/g</span>, <span class="string">'>'</span>);827-};</code></pre>828-</td>779 </tr><tr class="filename"><td><h2 id="lib/express/view.js">view</h2></td><td>lib/express/view.js</td></tr><tr class="code">780 <td class="docs">781 <p>Module dependencies.</p>782 </td>40 unmodified lines823 824 <ul>825 <li><strong>api</strong>: <em>public</em></li>826 </ul>877-$P827+828 </td>829 <td class="code">830 <pre><code><span class="variable">exports</span>.<span class="variable">clearCache</span> = <span class="keyword">function</span>(){831 <span class="variable">viewCache</span> = {};6 unmodified lines838 839 <ul>840 <li><strong>type</strong>: <em>Object</em></li>841 </ul>892-$P842+843 </td>844 <td class="code">845 <pre><code><span class="keyword">var</span> <span class="variable">helpers</span> = <span class="variable">exports</span>.<span class="variable">helpers</span> = {};</code></pre>846 </td>25 unmodified lines872 <li><p><strong>param</strong>: <em>Object | Array</em> options or collection</p></li>873 <li><p><strong>return</strong>: <em>String</em></p></li>874 <li><p><strong>api</strong>: <em>public</em></p></li>875 </ul>926-\Q876+ZQ877 </td>878 <td class="code">879 <pre><code><span class="variable">http</span>.<span class="class">ServerResponse</span>.<span class="variable">prototype</span>.<span class="variable">partial</span> = <span class="keyword">function</span>(<span class="variable">view</span>, <span class="variable">options</span>, <span class="variable">ext</span>){880 <span class="keyword">if</span> (<span class="variable">ext</span> &<span class="variable">amp</span>;&<span class="variable">amp</span>; <span class="variable">view</span>.<span class="variable">indexOf</span>(<span class="string">'.'</span>) &<span class="variable">lt</span>; <span class="number integer">0</span>) {57 unmodified lines938 <li><p><strong>param</strong>: <em>Object</em> options</p></li>939 <li><p><strong>param</strong>: <em>Function</em> fn</p></li>940 <li><p><strong>api</strong>: <em>public</em></p></li>941 </ul>992-�942+943 </td>944 <td class="code">945 <pre><code><span class="variable">http</span>.<span class="class">ServerResponse</span>.<span class="variable">prototype</span>.<span class="variable">render</span> = <span class="keyword">function</span>(<span class="variable">view</span>, <span class="variable">options</span>, <span class="variable">fn</span>){946 <span class="variable">options</span> = <span class="variable">options</span> || {};87 unmodified lines1034 }1035 };1036 </code></pre>1037 </td>1038+</tr><tr class="filename"><td><h2 id="lib/express/utils.js">utils</h2></td><td>lib/express/utils.js</td></tr><tr class="code">1039+<td class="docs">1040+<p>Parse mini markdown implementation.1041+The following conversions are supported,1042+primarily for the “flash” middleware:</p>1043+1044+<p> <em>foo</em> or <em>foo</em> become <em>foo</em>1045+ <strong>foo</strong> or <strong>foo</strong> become <strong>foo</strong>1046+ <a href="B">A</a> becomes <a href="B">A</a></p>1047+1048+<h2></h2>1049+1050+<ul>1051+<li><p><strong>param</strong>: <em>String</em> str</p></li>1052+<li><p><strong>return</strong>: <em>String</em></p></li>1053+<li><p><strong>api</strong>: <em>public</em></p></li>1054+</ul>1055+1056+</td>1057+<td class="code">1058+<pre><code><span class="variable">exports</span>.<span class="variable">miniMarkdown</span> = <span class="keyword">function</span>(<span class="variable">str</span>){1059+ <span class="keyword">return</span> <span class="class">String</span>(<span class="variable">str</span>)1060+ .<span class="variable">replace</span>(<span class="regexp">/(__|\*\*)(.*?)\1/g</span>, <span class="string">'<strong>$2</strong>'</span>)1061+ .<span class="variable">replace</span>(<span class="regexp">/(_|\*)(.*?)\1/g</span>, <span class="string">'<em>$2</em>'</span>)1062+ .<span class="variable">replace</span>(<span class="regexp">/\[([^\]]+)\]\(([^)]+)\)/g</span>, <span class="string">'<a href="$2">$1</a>'</span>);1063+};</code></pre>1064+</td>1065+</tr>1066+<tr class="code">1067+<td class="docs">1068+<p>Escape special characters in the given string of html.</p>1069+1070+<h2></h2>1071+1072+<ul>1073+<li><p><strong>param</strong>: <em>String</em> html</p></li>1074+<li><p><strong>return</strong>: <em>String</em></p></li>1075+<li><p><strong>api</strong>: <em>public</em></p></li>1076+</ul>1077+1078+</td>1079+<td class="code">1080+<pre><code><span class="variable">exports</span>.<span class="variable">htmlEscape</span> = <span class="keyword">function</span>(<span class="variable">html</span>) {1081+ <span class="keyword">return</span> <span class="class">String</span>(<span class="variable">html</span>)1082+ .<span class="variable">replace</span>(<span class="regexp">/&/g</span>, <span class="string">'&'</span>)1083+ .<span class="variable">replace</span>(<span class="regexp">/"/g</span>, <span class="string">'"'</span>)1084+ .<span class="variable">replace</span>(<span class="regexp">/</g</span>, <span class="string">'<'</span>)1085+ .<span class="variable">replace</span>(<span class="regexp">/>/g</span>, <span class="string">'>'</span>);1086+};</code></pre>1087+</td>1088 </tr> </body>1089 </html></tbody></table>modified:docs/executable.html+7 added-2 removed
4 unmodified lines5 #header {6 position: absolute;7 top: 10px;8 left: 0;9- padding: 12px 40px;9+ padding: 12px 0;10+ text-indent: 40px;11 width: 100%;12 border-top: 1px solid rgba(0,0,0,0.7);13 border-bottom: 1px solid rgba(0,0,0,0.7);14 background: rgba(255,255,255,0.1) url(http://www.sencha.com/favicon.ico) no-repeat 15px 50%;98 unmodified lines113 padding-top: 110px;114 width: 550px; }115 116 #menu {116- margin-left: 125px;117+ margin-left: 130px;118 padding: 0;119 padding-bottom: 30px; }120 #menu li {121 display: inline;28 unmodified lines150 <div id="header"><strong>Sencha</strong> labs</div>151 <div id="wrapper">152 <div id="container">153 <a href='http://github.com/visionmedia/express' id='logo'>Express</a> 154+ <p id="tagline">155+ High performance, high class web development for156+ <a href="http://nodejs.org">Node.js</a>157+ </p>158 <ul id="menu">159 <li><a href="index.html">Home</a></li>160 <li><a href="guide.html">Guide</a></li>161 <li><a href="migrate.html">1.x Migration</a></li>24 unmodified linesmodified:docs/index.1-1 removed
1 .\" generated with Ronn/v0.6.62 .\" http://github.com/rtomayko/ronn/3 .4 .TH "INDEX" "" "July 2010" "" ""5-High performance, high class web development for Node\.js \fIhttp://nodejs\.org\fR5 .6 .IP "" 47 .8 .nf60 unmodified linesmodified:docs/index.html+7 added-10 removed
4 unmodified lines5 #header {6 position: absolute;7 top: 10px;8 left: 0;9- padding: 12px 40px;9+ padding: 12px 0;10+ text-indent: 40px;11 width: 100%;12 border-top: 1px solid rgba(0,0,0,0.7);13 border-bottom: 1px solid rgba(0,0,0,0.7);14 background: rgba(255,255,255,0.1) url(http://www.sencha.com/favicon.ico) no-repeat 15px 50%;98 unmodified lines113 padding-top: 110px;114 width: 550px; }115 116 #menu {116- margin-left: 125px;117+ margin-left: 130px;118 padding: 0;119 padding-bottom: 30px; }120 #menu li {121 display: inline;28 unmodified lines150 <div id="header"><strong>Sencha</strong> labs</div>151 <div id="wrapper">152 <div id="container">153 <a href='http://github.com/visionmedia/express' id='logo'>Express</a> 154+ <p id="tagline">155+ High performance, high class web development for156+ <a href="http://nodejs.org">Node.js</a>157+ </p>158 <ul id="menu">159 <li><a href="index.html">Home</a></li>160 <li><a href="guide.html">Guide</a></li>161 <li><a href="migrate.html">1.x Migration</a></li>162 </ul>163 <div class='mp'>159-160-161-<p id="tagline">162- High performance, high class web development for163- <a href="http://nodejs.org">Node.js</a>164-</p>165-166-164 <pre><code>var app = express.createServer();165 166 app.get('/', function(req, res){167 res.send('Hello World');40 unmodified linesmodified:docs/index.md-5 removed
123456234524 unmodified lines
<p id="tagline"> High performance, high class web development for <a href="http://nodejs.org">Node.js</a></p>
var app = express.createServer(); app.get('/', function(req, res){ res.send('Hello World');24 unmodified linesmodified:docs/migrate.html+7 added-2 removed
4 unmodified lines5 #header {6 position: absolute;7 top: 10px;8 left: 0;9- padding: 12px 40px;9+ padding: 12px 0;10+ text-indent: 40px;11 width: 100%;12 border-top: 1px solid rgba(0,0,0,0.7);13 border-bottom: 1px solid rgba(0,0,0,0.7);14 background: rgba(255,255,255,0.1) url(http://www.sencha.com/favicon.ico) no-repeat 15px 50%;98 unmodified lines113 padding-top: 110px;114 width: 550px; }115 116 #menu {116- margin-left: 125px;117+ margin-left: 130px;118 padding: 0;119 padding-bottom: 30px; }120 #menu li {121 display: inline;28 unmodified lines150 <div id="header"><strong>Sencha</strong> labs</div>151 <div id="wrapper">152 <div id="container">153 <a href='http://github.com/visionmedia/express' id='logo'>Express</a> 154+ <p id="tagline">155+ High performance, high class web development for156+ <a href="http://nodejs.org">Node.js</a>157+ </p>158 <ul id="menu">159 <li><a href="index.html">Home</a></li>160 <li><a href="guide.html">Guide</a></li>161 <li><a href="migrate.html">1.x Migration</a></li>204 unmodified lines