Updated docs
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 aaa5deb · Browse files · 7 files·+76 added−78 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+76 added−78 removed
- other:+76 added−78 removed
Provenance
- Commit
3234329- Tree
f165bb9- Author
Tj Holowaychuk <tj@vision-media.ca>- Committer
Tj Holowaychuk <tj@vision-media.ca>- Parent
aaa5deb
7 files changed+76 added−78 removed
modified:docs/api.html+46 added-62 removed
112 unmodified lines113 <p>Framework version.114 </p>115 </td>116 <td class="code">117-<pre><code><span class="variable">exports</span>.<span class="variable">version</span> = <span class="string">'1.0.0beta2'</span>;</code></pre>117+<pre><code><span class="variable">exports</span>.<span class="variable">version</span> = <span class="string">'1.0.0rc'</span>;</code></pre>118 </td>119 </tr>120 <tr class="code">121 <td class="docs">457 unmodified lines579 <span class="this">this</span>.<span class="variable">end</span>();580 };581 </code></pre>582 </td>583-</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">584-<td class="docs">585-<p>Parse mini markdown implementation.586-The following conversions are supported,587-primarily for the "flash" middleware:</p>588-589-<p> <em>foo</em> or <em>foo</em> become <em>foo</em>590- <strong>foo</strong> or <strong>foo</strong> become <strong>foo</strong>591- <a href="B">A</a> becomes <a href="B">A</a></p>592-593-<h2></h2>594-595-<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>596-</td>597-<td class="code">598-<pre><code><span class="variable">exports</span>.<span class="variable">miniMarkdown</span> = <span class="keyword">function</span>(<span class="variable">str</span>){599- <span class="keyword">return</span> <span class="class">String</span>(<span class="variable">str</span>)600- .<span class="variable">replace</span>(<span class="regexp">/(__|\*\*)(.*?)\1/g</span>, <span class="string">'<strong>$2</strong>'</span>)601- .<span class="variable">replace</span>(<span class="regexp">/(_|\*)(.*?)\1/g</span>, <span class="string">'<em>$2</em>'</span>)602- .<span class="variable">replace</span>(<span class="regexp">/\[([^\]]+)\]\(([^)]+)\)/g</span>, <span class="string">'<a href="$2">$1</a>'</span>);603-};</code></pre>604-</td>605-</tr>606-<tr class="code">607-<td class="docs">608-<p>Escape special characters in the given string of html.</p>609-610-<h2></h2>611-612-<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>613-</td>614-<td class="code">615-<pre><code><span class="variable">exports</span>.<span class="variable">htmlEscape</span> = <span class="keyword">function</span>(<span class="variable">html</span>) {616- <span class="keyword">return</span> <span class="class">String</span>(<span class="variable">html</span>)617- .<span class="variable">replace</span>(<span class="regexp">/&/g</span>, <span class="string">'&'</span>)618- .<span class="variable">replace</span>(<span class="regexp">/"/g</span>, <span class="string">'"'</span>)619- .<span class="variable">replace</span>(<span class="regexp">/</g</span>, <span class="string">'<'</span>)620- .<span class="variable">replace</span>(<span class="regexp">/>/g</span>, <span class="string">'>'</span>);621-};</code></pre>622-</td>583 </tr><tr class="filename"><td><h2 id="lib/express/server.js"><a href="#">server</a></h2></td><td>lib/express/server.js</td></tr><tr class="code">584 <td class="docs">585 <p>Module dependencies.586 </p>28 unmodified lines615 616 <span class="comment">// Default "home" to / </span>617 <span class="this">this</span>.<span class="variable">set</span>(<span class="string">'home'</span>, <span class="string">'/'</span>);618 659- <span class="comment">// Set "env" to {EXPRESS,CONNECT}_ENV</span>660- <span class="this">this</span>.<span class="variable">set</span>(<span class="string">'env'</span>, <span class="variable">process</span>.<span class="variable">env</span>.<span class="class">EXPRESS_ENV</span> || <span class="variable">process</span>.<span class="variable">connectEnv</span>.<span class="variable">name</span>);619+ <span class="comment">// Set "env" to EXPRESS_ENV or connectEnv.name</span>620+ <span class="this">this</span>.<span class="variable">set</span>(<span class="string">'env'</span>,621+ <span class="variable">process</span>.<span class="variable">env</span>.<span class="class">EXPRESS_ENV</span> ||622+ <span class="variable">process</span>.<span class="variable">connectEnv</span>.<span class="variable">name</span>);623 624 <span class="comment">// Expose objects to each other</span>625 <span class="this">this</span>.<span class="variable">use</span>(<span class="keyword">function</span>(<span class="variable">req</span>, <span class="variable">res</span>, <span class="variable">next</span>){626 <span class="variable">req</span>.<span class="variable">query</span> = {};29 unmodified lines656 </td>657 </tr>658 <tr class="code">659 <td class="docs">698-<p>Start listening on the given <code>port</code> / <code>host</code>.</p>699-700-<h2></h2>701-702-<ul><li><p><strong>param</strong>: <em>Number</em> port</p></li><li><p><strong>param</strong>: <em>String</em> host</p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>703-</td>704-<td class="code">705-<pre><code><span class="class">Server</span>.<span class="variable">prototype</span>.<span class="variable">listen</span> = <span class="keyword">function</span>(<span class="variable">port</span>, <span class="variable">host</span>){706- <span class="comment">// Setup view reloading</span>707- <span class="keyword">if</span> (<span class="this">this</span>.<span class="variable">set</span>(<span class="string">'reload views'</span>)) {708- <span class="variable">view</span>.<span class="variable">watcher</span>.<span class="variable">call</span>(<span class="this">this</span>, <span class="this">this</span>.<span class="variable">set</span>(<span class="string">'reload views'</span>));709- }710- <span class="variable">connect</span>.<span class="class">Server</span>.<span class="variable">prototype</span>.<span class="variable">listen</span>.<span class="variable">call</span>(<span class="this">this</span>, <span class="variable">port</span>, <span class="variable">host</span>);711-};</code></pre>712-</td>713-</tr>714-<tr class="code">715-<td class="docs">660 <p>Proxy <code>connect.Server#use()</code> to apply settings to661 mounted applications.</p>662 663 <h2></h2>194 unmodified lines858 <span class="keyword">return</span> <span class="variable">arguments</span>.<span class="variable">callee</span>;859 })(<span class="string">'get'</span>)(<span class="string">'post'</span>)(<span class="string">'put'</span>)(<span class="string">'del'</span>);860 </code></pre>861 </td>862+</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">863+<td class="docs">864+<p>Parse mini markdown implementation.865+The following conversions are supported,866+primarily for the "flash" middleware:</p>867+868+<p> <em>foo</em> or <em>foo</em> become <em>foo</em>869+ <strong>foo</strong> or <strong>foo</strong> become <strong>foo</strong>870+ <a href="B">A</a> becomes <a href="B">A</a></p>871+872+<h2></h2>873+874+<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>875+</td>876+<td class="code">877+<pre><code><span class="variable">exports</span>.<span class="variable">miniMarkdown</span> = <span class="keyword">function</span>(<span class="variable">str</span>){878+ <span class="keyword">return</span> <span class="class">String</span>(<span class="variable">str</span>)879+ .<span class="variable">replace</span>(<span class="regexp">/(__|\*\*)(.*?)\1/g</span>, <span class="string">'<strong>$2</strong>'</span>)880+ .<span class="variable">replace</span>(<span class="regexp">/(_|\*)(.*?)\1/g</span>, <span class="string">'<em>$2</em>'</span>)881+ .<span class="variable">replace</span>(<span class="regexp">/\[([^\]]+)\]\(([^)]+)\)/g</span>, <span class="string">'<a href="$2">$1</a>'</span>);882+};</code></pre>883+</td>884+</tr>885+<tr class="code">886+<td class="docs">887+<p>Escape special characters in the given string of html.</p>888+889+<h2></h2>890+891+<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>892+</td>893+<td class="code">894+<pre><code><span class="variable">exports</span>.<span class="variable">htmlEscape</span> = <span class="keyword">function</span>(<span class="variable">html</span>) {895+ <span class="keyword">return</span> <span class="class">String</span>(<span class="variable">html</span>)896+ .<span class="variable">replace</span>(<span class="regexp">/&/g</span>, <span class="string">'&'</span>)897+ .<span class="variable">replace</span>(<span class="regexp">/"/g</span>, <span class="string">'"'</span>)898+ .<span class="variable">replace</span>(<span class="regexp">/</g</span>, <span class="string">'<'</span>)899+ .<span class="variable">replace</span>(<span class="regexp">/>/g</span>, <span class="string">'>'</span>);900+};</code></pre>901+</td>902 </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">903 <td class="docs">904 <p>Module dependencies.905 </p>112 unmodified lines1018 1019 <p> Most engines accept one or more of the following options,1020 both <em>haml</em> and <em>jade</em> accept all:</p>1021 1038-<ul><li><code>context|scope</code> Template evaluation context (<code>this</code>)</li><li><code>locals</code> Object containing local variables</li><li><code>filename</code> Filename used for the <code>cache</code> option</li><li><code>cache</code> Cache intermediate JavaScript in memory</li><li><code>debug</code> Output debugging information</li></ul>1022+<ul><li><code>context|scope</code> Template evaluation context (<code>this</code>)</li><li><code>locals</code> Object containing local variables</li><li><code>debug</code> Output debugging information</li></ul>1023 1024 <h2></h2>1025 1026 <ul><li><p><strong>param</strong>: <em>String</em> view</p></li><li><p><strong>param</strong>: <em>Object</em> options</p></li><li><p><strong>param</strong>: <em>Function</em> fn</p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>114 unmodified linesmodified:docs/contrib.1+3 added-1 removed
72 unmodified lines73 .IP "\(bu" 474 Indents are \fI4\fR spaces\.75 .76 .IP "" 077-77+.78+.SS "Documentation"79+To contribute documentation edit the markdown files in \fI\./docs\fR, however do \fInot\fR run \fImake docs\fR, as they will be re\-built and published with each release\.modified:docs/contrib.html+5 added
229 unmodified lines230 <li>Indents are <em>4</em> spaces.</li>231 </ul>232 233 234+<h3 id="Documentation">Documentation</h3>235+236+<p>To contribute documentation edit the markdown files in <em>./docs</em>, however237+do <em>not</em> run <em>make docs</em>, as they will be re-built and published with each release.</p>238+239 </div>240 </div>241 </div>242 </body>1 unmodified linemodified:docs/guide.1+3 added-9 removed
141 unmodified lines142 .143 .IP "\(bu" 4144 \fIview engine\fR Default view engine name for views rendered without extensions145 .146-.IP "\(bu" 4147-\fIreload views\fR Reloads altered views, by default watches for \fImtime\fR changes with with a 500 millisecond interval\.148-.146 .IP "" 0147 .148 .SS "Routing"149 Express utilizes the HTTP verbs to provide a meaningful, expressive routing API\. For example we may want to render a user\'s account for the path \fI/user/12\fR, this can be done by defining the route below\. The values associated to the named placeholders are available as \fBreq\.params\fR\.631 unmodified lines781 .IP "\(bu" 4782 \fIlocals\fR Object containing local variables783 .784 .IP "\(bu" 4788-\fIcache\fR Cache intermediate JavaScript in memory (the default in \fIproduction\fR mode)789-.790-.IP "\(bu" 4785 \fIdebug\fR Output debugging information786 .787 .IP "" 0788 .84 unmodified lines873 .IP "" 4874 .875 .nf876 883-app\.set(\'reload views\', 200);884-app\.set(\'reload views\');885-// => 200877+app\.set(\'views\', __dirname + \'/views\');878+app\.set(\'views\');879+// => \.\.\.path\.\.\.880 .881 .fi882 .883 .IP "" 0243 unmodified linesmodified:docs/guide.html+3 added-6 removed
317 unmodified lines318 <li><em>env</em> Application environment set internally, use <em>app.set('env')</em> on <em>Server#listen()</em></li>319 <li><em>home</em> Application base path used for <em>res.redirect()</em> and transparently handling mounted apps.</li>320 <li><em>views</em> Root views directory defaulting to <strong>CWD/views</strong></li>321 <li><em>view engine</em> Default view engine name for views rendered without extensions</li>322-<li><em>reload views</em> Reloads altered views, by default watches for <em>mtime</em> changes with323- with a 500 millisecond interval.</li>322 </ul>323 324 325 <h3 id="Routing">Routing</h3>429 unmodified lines755 756 <ul>757 <li><em>context|scope</em> Template evaluation context (<em>this</em>)</li>758 <li><em>locals</em> Object containing local variables</li>761-<li><em>cache</em> Cache intermediate JavaScript in memory (the default in <em>production</em> mode)</li>759 <li><em>debug</em> Output debugging information</li>760 </ul>761 762 49 unmodified lines812 813 <p>Apply an application level setting <em>name</em> to <em>val</em>, or814 get the value of <em>name</em> when <em>val</em> is not present:</p>815 819-<pre><code>app.set('reload views', 200);820-app.set('reload views');821-// => 200816+<pre><code>app.set('views', __dirname + '/views');817+app.set('views');818+// => ...path...819 </code></pre>820 821 <h3 id="app-enable-name-">app.enable(name)</h3>822 150 unmodified linesmodified:docs/index.1+12 added
96 unmodified lines97 .98 .SH "Apps Using Express"99 .100 .IP "\(bu" 4101+wtfjs \fIhttp://wtfjs\.com/\fR \- JavaScript WTFs :)102+.103+.IP "\(bu" 4104 Node Knockout \fIhttp://nodeknockout\.com/\fR \- node knockout competition site105 .106 .IP "\(bu" 4107 Node News \fIhttp://nodejs\.se/\fR \- node news aggregator108 .109+.IP "\(bu" 4110+Code Shelver \fIhttp://codeshelver\.com/\fR \- GitHub watch list app111+.112+.IP "\(bu" 4113+Clickdummy \fIhttp://clickdummy\.net/\fR \- Fast prototyping for designers114+.115+.IP "\(bu" 4116+E\-Resistible \fIe\-resistible\.co\.uk\fR \- Online takeaway ordering app117+.118 .IP "" 0119 modified:docs/index.html+4 added
242 unmodified lines243 244 <h2 id="Apps-Using-Express">Apps Using Express</h2>245 246 <ul>247+<li><a href="http://wtfjs.com/">wtfjs</a> - JavaScript WTFs :)</li>248 <li><a href="http://nodeknockout.com/">Node Knockout</a> - node knockout competition site</li>249 <li><a href="http://nodejs.se/">Node News</a> - node news aggregator</li>250+<li><a href="http://codeshelver.com/">Code Shelver</a> - GitHub watch list app</li>251+<li><a href="http://clickdummy.net/">Clickdummy</a> - Fast prototyping for designers</li>252+<li><a href="e-resistible.co.uk">E-Resistible</a> - Online takeaway ordering app</li>253 </ul>254 255 256 </div>4 unmodified lines