| 1 |
|
| 2 |
<HTML> |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
<HEAD> |
| 29 |
<TITLE>7.2 Getting Started</TITLE> |
| 30 |
<STYLE TYPE="text/css"> <!-- A {text-decoration: none} // --> </STYLE> |
| 31 |
</HEAD> |
| 32 |
<BODY BACKGROUND="binary/background.gif" |
| 33 |
BGCOLOR="#FFFFFF" |
| 34 |
TEXT="#000000" |
| 35 |
VLINK="#660000" |
| 36 |
LINK="#FF0000" |
| 37 |
ALINK="#CC0000"> |
| 38 |
|
| 39 |
<TABLE WIDTH="490"> |
| 40 |
<TR> |
| 41 |
<TD WIDTH="130" VALIGN="top"> |
| 42 |
<IMG SRC="binary/d_clear.gif" ALT="" WIDTH="130" HEIGHT="1"><BR> |
| 43 |
|
| 44 |
<FONT SIZE="2"> |
| 45 |
<BR> |
| 46 |
|
| 47 |
<A HREF="http://www.ross.net/" |
| 48 |
TARGET="rosshome" |
| 49 |
onClick="window.open('','rosshome','location,status,menubar,scrollbars,resizable',false).focus(); return true;" |
| 50 |
> |
| 51 |
<IMG SRC="binary/rossnet_logo.gif" |
| 52 |
WIDTH="64" HEIGHT="32" |
| 53 |
BORDER="0" ALT="RossNet" |
| 54 |
HSPACE="0" VSPACE="1"></A><BR> |
| 55 |
<BR> |
| 56 |
|
| 57 |
<A HREF="../index.shtml" |
| 58 |
TARGET="funnelweb" |
| 59 |
onClick="window.open('','funnelweb','location,status,menubar,scrollbars,resizable',false).focus(); return true;" |
| 60 |
> |
| 61 |
<IMG SRC="binary/linklogo.gif" |
| 62 |
WIDTH="64" HEIGHT="32" |
| 63 |
BORDER="0" ALT="FunnelWeb" |
| 64 |
HSPACE="0" VSPACE="1"></A><BR> |
| 65 |
<BR> |
| 66 |
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD BGCOLOR="#000000"> |
| 67 |
<A HREF="../reference/index.html" |
| 68 |
TARGET="funnelwebreference" |
| 69 |
onClick="window.open('','funnelwebreference','location,status,menubar,scrollbars,resizable',false).focus(); return true;" |
| 70 |
><FONT COLOR="#FFFFFF"><B>Reference</B></FONT></A><BR> |
| 71 |
<BR> |
| 72 |
<A HREF="../developer/index.html" |
| 73 |
TARGET="funnelwebdeveloper" |
| 74 |
onClick="window.open('','funnelwebdeveloper','location,status,menubar,scrollbars,resizable',false).focus(); return true;" |
| 75 |
><FONT COLOR="#FFFFFF"><B>Developer</B></FONT></A><BR> |
| 76 |
<BR> |
| 77 |
<A HREF="index.html"><FONT COLOR="#FFFFFF"><B>Tutorial</B></FONT></A><BR> |
| 78 |
<A HREF="intro.html"><FONT COLOR="#FFFFFF">1 Introduction</FONT></A><BR> |
| 79 |
<A HREF="macro.html"><FONT COLOR="#FFFFFF">2 Macros</FONT></A><BR> |
| 80 |
<A HREF="type.html"><FONT COLOR="#FFFFFF">3 Typesetting</FONT></A><BR> |
| 81 |
<A HREF="example.html"><FONT COLOR="#FFFFFF">4 Example</FONT></A><BR> |
| 82 |
<A HREF="hints.html"><FONT COLOR="#FFFFFF">5 Hints</FONT></A><BR> |
| 83 |
<A HREF="examples.html"><FONT COLOR="#FFFFFF">6 Examples</FONT></A><BR> |
| 84 |
<A HREF="web.html"><FONT COLOR="#FFFFFF">7 Webmaking</FONT></A><BR> |
| 85 |
|
| 86 |
<BR> |
| 87 |
<A HREF="search.html"><FONT COLOR="#FFFFFF"><B>SEARCH</B></FONT></A><BR> |
| 88 |
</FONT> |
| 89 |
</TD></TR></TABLE> |
| 90 |
|
| 91 |
|
| 92 |
</TD> |
| 93 |
<TD WIDTH="360" VALIGN="top"> |
| 94 |
<FONT SIZE="3"> |
| 95 |
|
| 96 |
|
| 97 |
<A HREF="../reference/index.html"><IMG SRC="binary/title.gif" |
| 98 |
WIDTH="302" HEIGHT="24" |
| 99 |
BORDER="0" ALT="FunnelWeb Tutorial Manual" |
| 100 |
HSPACE="0" VSPACE="0"></A> |
| 101 |
<P><FONT SIZE="5">7.2 Getting Started</FONT><BR> |
| 102 |
|
| 103 |
|
| 104 |
<P>This page contains a brief hands-on tutorial to get you started |
| 105 |
in using FunnelWeb to make webs. |
| 106 |
|
| 107 |
<P><BR><FONT SIZE="4"><STRONG>Hello Web</STRONG></FONT><BR> |
| 108 |
|
| 109 |
<P>The best way to understand how FunnelWeb can help you make webs |
| 110 |
is to work through a simple example. Here is one: |
| 111 |
|
| 112 |
<P> |
| 113 |
<PRE> |
| 114 |
@!************************************************ |
| 115 |
|
| 116 |
@O@<index.html@>@{ |
| 117 |
<HTML> |
| 118 |
|
| 119 |
<HEAD> |
| 120 |
<TITLE>Dave's Home Page</TITLE> |
| 121 |
</HEAD> |
| 122 |
|
| 123 |
<BODY BGCOLOR=#FFFFFF> |
| 124 |
<P>Welcome to my home page. Check out my |
| 125 |
<A HREF="links.html">links page</A>. |
| 126 |
</BODY> |
| 127 |
|
| 128 |
</HTML> |
| 129 |
@} |
| 130 |
|
| 131 |
@!************************************************ |
| 132 |
|
| 133 |
@O@<links.html@>@{ |
| 134 |
<HTML> |
| 135 |
|
| 136 |
<HEAD> |
| 137 |
<TITLE>Dave's Links</TITLE> |
| 138 |
</HEAD> |
| 139 |
|
| 140 |
<BODY BGCOLOR=#FFFFFF> |
| 141 |
<P>Here are my links: |
| 142 |
|
| 143 |
<P> |
| 144 |
<A HREF="http://www.yahoo.com/">Yahoo</A><BR> |
| 145 |
<A HREF="http://www.dilbert.com/">Dilbert</A><BR> |
| 146 |
</BODY> |
| 147 |
|
| 148 |
</HTML> |
| 149 |
@} |
| 150 |
|
| 151 |
@!************************************************ |
| 152 |
</PRE> |
| 153 |
|
| 154 |
<P>Cut and paste the above text into a file called <SAMP>dave.fw</SAMP> |
| 155 |
and run FunnelWeb on it by giving the command: |
| 156 |
|
| 157 |
<P> |
| 158 |
<PRE> |
| 159 |
fw dave |
| 160 |
</PRE> |
| 161 |
|
| 162 |
<P> |
| 163 |
<BLOCKQUOTE> |
| 164 |
<FONT SIZE="2"> |
| 165 |
<STRONG>Note:</STRONG> On my computer, when you cut and paste text |
| 166 |
from a web page, the pasted text contains a block of blanks |
| 167 |
before each line; you will have to delete these to make the |
| 168 |
example work, as FunnelWeb requires the first line of macro |
| 169 |
definitions to be in column one. |
| 170 |
</FONT> |
| 171 |
</BLOCKQUOTE> |
| 172 |
|
| 173 |
<P>If all goes well, FunnelWeb should write out two files |
| 174 |
<SAMP>index.html</SAMP> and <SAMP>links.html</SAMP>. That's the |
| 175 |
generated web, and you should be able to browse it using your |
| 176 |
favorite web browser. |
| 177 |
|
| 178 |
<P><BR><FONT SIZE="4"><STRONG>First Glimmers Of Usefulness</STRONG></FONT><BR> |
| 179 |
|
| 180 |
<P>The sole benefit we have obtained so far is that the web |
| 181 |
is represented as a single file. This confers quite a few benefits |
| 182 |
on its own for medium-sized webs, such as the elimination of |
| 183 |
the need to perform multiple-file search and replace operations, |
| 184 |
but it's really only a start. |
| 185 |
|
| 186 |
<P>The next step is to recognise that the two pages above share |
| 187 |
quite a lot of text and that that text can be removed into FunnelWeb |
| 188 |
macros. |
| 189 |
|
| 190 |
<P> |
| 191 |
<PRE> |
| 192 |
@!************************************************ |
| 193 |
|
| 194 |
@$@<Begin page@>@(@1@)@M@{ |
| 195 |
<HTML> |
| 196 |
<HEAD> |
| 197 |
<TITLE>@1</TITLE> |
| 198 |
</HEAD> |
| 199 |
<BODY BGCOLOR=#FFFFFF> |
| 200 |
@} |
| 201 |
|
| 202 |
@$@<End page@>@M@{ |
| 203 |
</BODY> |
| 204 |
</HTML> |
| 205 |
@} |
| 206 |
|
| 207 |
@!************************************************ |
| 208 |
|
| 209 |
@O@<index.html@>@{ |
| 210 |
|
| 211 |
@<Begin page@>@(Dave's Home Page@) |
| 212 |
|
| 213 |
<P>Welcome to my home page. Check out my |
| 214 |
<A HREF="links.html">links page</A>. |
| 215 |
|
| 216 |
@<End page@> |
| 217 |
@} |
| 218 |
|
| 219 |
@!************************************************ |
| 220 |
|
| 221 |
@O@<links.html@>@{ |
| 222 |
@<Begin page@>@(Dave's Links@) |
| 223 |
|
| 224 |
<P>Here are my links: |
| 225 |
|
| 226 |
<P> |
| 227 |
<A HREF="http://www.yahoo.com/">Yahoo</A><BR> |
| 228 |
<A HREF="http://www.dilbert.com/">Dilbert</A><BR> |
| 229 |
|
| 230 |
@<End page@> |
| 231 |
@} |
| 232 |
|
| 233 |
@!************************************************ |
| 234 |
</PRE> |
| 235 |
|
| 236 |
<P>Now, although the file has actually got a little longer and |
| 237 |
looks far more complicated than it did, we've actually managed |
| 238 |
to extract two significant benefits from this reorganization. |
| 239 |
|
| 240 |
<P><BLOCKQUOTE><B>Page style:</B> First, almost without even |
| 241 |
trying, we've created a page style. For example, to change |
| 242 |
the colour of all the pages in the web, we need just change |
| 243 |
the single body definition in the begin page macro. |
| 244 |
Similarly, if we wanted to add a copyright notice at the |
| 245 |
bottom of each page, we need change only the end page |
| 246 |
macro.</BLOCKQUOTE> |
| 247 |
|
| 248 |
<P><BLOCKQUOTE><B>Page overhead:</B> Second, we've reduced the |
| 249 |
amount of text required to define each page. Instead of |
| 250 |
requiring ten lines of HTML to set up each page, we need |
| 251 |
just two FunnelWeb calls (two lines); the rest is text |
| 252 |
particular to the page being defined.</BLOCKQUOTE> |
| 253 |
|
| 254 |
<P>These advantages may seem minor, but when scaled up to a |
| 255 |
web containing a dozen or more pages, they become very significant. |
| 256 |
|
| 257 |
<P>The newfound power, in the case of the example, can be demonstrated |
| 258 |
by changing the web from black on white to blue on white, and by adding |
| 259 |
another page: |
| 260 |
|
| 261 |
<P> |
| 262 |
<PRE> |
| 263 |
@!************************************************ |
| 264 |
|
| 265 |
@$@<Begin page@>@(@1@)@M@{ |
| 266 |
<HTML> |
| 267 |
<HEAD> |
| 268 |
<TITLE>@1</TITLE> |
| 269 |
</HEAD> |
| 270 |
<BODY BGCOLOR=#FFFFFF TEXT=#000033> |
| 271 |
@} |
| 272 |
|
| 273 |
@$@<End page@>@m@{ |
| 274 |
</BODY> |
| 275 |
</HTML> |
| 276 |
@} |
| 277 |
|
| 278 |
@!************************************************ |
| 279 |
|
| 280 |
@O@<index.html@>@{ |
| 281 |
@<Begin page@>@(Dave's Home Page@) |
| 282 |
|
| 283 |
<P>Welcome to my home page. Check out my |
| 284 |
<A HREF="links.html">links page</A> and my |
| 285 |
<A HREF="hobbies.html">hobbies page</A>. |
| 286 |
|
| 287 |
@<End page@> |
| 288 |
@} |
| 289 |
|
| 290 |
@!************************************************ |
| 291 |
|
| 292 |
@O@<links.html@>@{ |
| 293 |
@<Begin page@>@(Dave's Links@) |
| 294 |
|
| 295 |
<P>Here are my links: |
| 296 |
|
| 297 |
<P> |
| 298 |
<A HREF="http://www.yahoo.com/">Yahoo</A><BR> |
| 299 |
<A HREF="http://www.dilbert.com/">Dilbert</A><BR> |
| 300 |
|
| 301 |
@<End page@> |
| 302 |
@} |
| 303 |
|
| 304 |
@!************************************************ |
| 305 |
|
| 306 |
@O@<hobbies.html@>@{ |
| 307 |
@<Begin page@>@(Dave's Hobbies@) |
| 308 |
|
| 309 |
<P>This page is under construction! |
| 310 |
|
| 311 |
@<End page@> |
| 312 |
@} |
| 313 |
|
| 314 |
@!************************************************ |
| 315 |
</PRE> |
| 316 |
|
| 317 |
<P>Now that you have a Hello World file to play with, the remaining |
| 318 |
sections of this chapter will discuss the ways in which you can |
| 319 |
use the macro power now at your fingertips. |
| 320 |
|
| 321 |
|
| 322 |
<P> |
| 323 |
<TABLE WIDTH="100%"> |
| 324 |
<TR> |
| 325 |
<TD ALIGN="left" VALIGN="bottom"><A HREF="web_introduction.html"><IMG SRC="binary/fw_left.gif" HEIGHT="32" WIDTH="32" BORDER="0" ALT="Prev"></A></TD> |
| 326 |
<TD ALIGN="center" VALIGN="bottom"><A HREF="web.html"><IMG SRC="binary/fw_up.gif" HEIGHT="32" WIDTH="32" BORDER="0" ALT="Up"></A></TD> |
| 327 |
<TD ALIGN="right" VALIGN="bottom"><A HREF="web_messy.html"><IMG SRC="binary/fw_right.gif" HEIGHT="32" WIDTH="32" BORDER="0" ALT="Next"></A></TD> |
| 328 |
</TR> |
| 329 |
</TABLE> |
| 330 |
|
| 331 |
|
| 332 |
|
| 333 |
<HR> |
| 334 |
<FONT SIZE="2"> |
| 335 |
<A HREF="mailto:[email protected]">Webmaster</A> |
| 336 |
<A HREF="copyright.html">Copyright © Ross N. Williams 1992,1999. All rights reserved.</A><BR> |
| 337 |
</FONT> |
| 338 |
|
| 339 |
</FONT> |
| 340 |
</TD> |
| 341 |
</TR> |
| 342 |
</TABLE> |
| 343 |
|
| 344 |
|
| 345 |
</BODY> |
| 346 |
|
| 347 |
|
| 348 |
|
| 349 |
|
| 350 |
|
| 351 |
</HTML> |