Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(915)

Side by Side Diff: doc/codelab/wiki/index.html

Issue 993042: code review 993042: codelab/index.html: a few typos. (Closed)
Patch Set: code review 993042: codelab/index.html: a few typos. Created 14 years, 10 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <div class="content"> 1 <div class="content">
2 2
3 <h1>Writing Web Applications</h1> 3 <h1>Writing Web Applications</h1>
4 4
5 <h2>Introduction</h2> 5 <h2>Introduction</h2>
6 6
7 <p> 7 <p>
8 Covered in this codelab: 8 Covered in this codelab:
9 </p> 9 </p>
10 <ul> 10 <ul>
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 body, err := ioutil.ReadFile(filename) 173 body, err := ioutil.ReadFile(filename)
174 if err != nil { 174 if err != nil {
175 return nil, err 175 return nil, err
176 } 176 }
177 return &amp;page{title: title, body: body}, nil 177 return &amp;page{title: title, body: body}, nil
178 } 178 }
179 </pre> 179 </pre>
180 180
181 <p> 181 <p>
182 Callers of this function can now check the second parameter; if it is 182 Callers of this function can now check the second parameter; if it is
183 <code>nil</code> then it has succesfully loaded a page. If not, it will be an 183 <code>nil</code> then it has successfully loaded a page. If not, it will be an
184 <code>os.Error</code> that can be handled by the caller (see the <a 184 <code>os.Error</code> that can be handled by the caller (see the <a
185 href="http://golang.org/pkg/os/#Error">os package documentation</a> for· 185 href="http://golang.org/pkg/os/#Error">os package documentation</a> for·
186 details). 186 details).
187 </p> 187 </p>
188 188
189 <p> 189 <p>
190 At this point we have a simple data structure and the ability to save to and 190 At this point we have a simple data structure and the ability to save to and
191 load from a file. Let's write a <code>main</code> function to test what we've 191 load from a file. Let's write a <code>main</code> function to test what we've
192 written: 192 written:
193 </p> 193 </p>
(...skipping 21 matching lines...) Expand all
215 <pre> 215 <pre>
216 $ 8g wiki.go 216 $ 8g wiki.go
217 $ 8l wiki.8 217 $ 8l wiki.8
218 $ ./8.out 218 $ ./8.out
219 This is a sample page. 219 This is a sample page.
220 </pre> 220 </pre>
221 221
222 <p> 222 <p>
223 (The <code>8g</code> and <code>8l</code> commands are applicable to 223 (The <code>8g</code> and <code>8l</code> commands are applicable to
224 <code>GOARCH=386</code>. If you're on an <code>amd64</code> system, 224 <code>GOARCH=386</code>. If you're on an <code>amd64</code> system,
225 subtitute 6's for the 8's.) 225 substitute 6's for the 8's.)
226 </p> 226 </p>
227 227
228 <p> 228 <p>
229 <a href="part1.go">Click here to view the code we've written so far.</a> 229 <a href="part1.go">Click here to view the code we've written so far.</a>
230 </p> 230 </p>
231 231
232 <h2>Introducing the <code>http</code> package (an interlude)</h2> 232 <h2>Introducing the <code>http</code> package (an interlude)</h2>
233 233
234 <p> 234 <p>
235 Here's a full working example of a simple web server: 235 Here's a full working example of a simple web server:
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 <pre> 445 <pre>
446 import ( 446 import (
447 "http" 447 "http"
448 "io/ioutil" 448 "io/ioutil"
449 "os" 449 "os"
450 <b>"template"</b> 450 <b>"template"</b>
451 ) 451 )
452 </pre> 452 </pre>
453 453
454 <p> 454 <p>
455 Let's create a template file containg the HTML form.· 455 Let's create a template file containing the HTML form.·
456 Open a new file named <code>edit.html</code>, and add the following lines: 456 Open a new file named <code>edit.html</code>, and add the following lines:
457 </p> 457 </p>
458 458
459 <pre> 459 <pre>
460 &lt;h1&gt;Editing {title}&lt;/h1&gt; 460 &lt;h1&gt;Editing {title}&lt;/h1&gt;
461 461
462 &lt;form action=&#34;/save/{title}&#34; method=&#34;POST&#34;&gt; 462 &lt;form action=&#34;/save/{title}&#34; method=&#34;POST&#34;&gt;
463 &lt;div&gt;&lt;textarea name=&#34;body&#34; rows=&#34;20&#34; cols=&#34;80&#34;& gt;{body|html}&lt;/textarea&gt;&lt;/div&gt; 463 &lt;div&gt;&lt;textarea name=&#34;body&#34; rows=&#34;20&#34; cols=&#34;80&#34;& gt;{body|html}&lt;/textarea&gt;&lt;/div&gt;
464 &lt;div&gt;&lt;input type=&#34;submit&#34; value=&#34;Save&#34;&gt;&lt;/div&gt; 464 &lt;div&gt;&lt;input type=&#34;submit&#34; value=&#34;Save&#34;&gt;&lt;/div&gt;
465 &lt;/form&gt; 465 &lt;/form&gt;
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
991 <li>Spruce up the page templates by making them valid HTML and adding some 991 <li>Spruce up the page templates by making them valid HTML and adding some
992 CSS rules.</li> 992 CSS rules.</li>
993 <li>Implement inter-page linking by converting instances of· 993 <li>Implement inter-page linking by converting instances of·
994 <code>[PageName]</code> to <br> 994 <code>[PageName]</code> to <br>
995 <code>&lt;a href="/view/PageName"&gt;PageName&lt;/a&gt;</code>. 995 <code>&lt;a href="/view/PageName"&gt;PageName&lt;/a&gt;</code>.
996 (hint: you could use <code>regexp.ReplaceAllFunc</code> to do this) 996 (hint: you could use <code>regexp.ReplaceAllFunc</code> to do this)
997 </li> 997 </li>
998 </ul> 998 </ul>
999 999
1000 </div> 1000 </div>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b