<HTML>
<HEAD>
  <META NAME="GENERATOR" CONTENT="Adobe PageMill 2.0 Mac">
  <TITLE>Writing Web Pages</TITLE>
</HEAD>
<BODY BGCOLOR="#62d6ac">

<P><CENTER><TABLE WIDTH="90%" BORDER="0" CELLSPACING="0" CELLPADDING="6">
<TR>
<TD WIDTH="100%" BGCOLOR="#eeeeee"><H1>WRITING WEB PAGES</H1>

<H2>THE BASICS:</H2>

<OL>
  <LI>Create a folder in your Notepad called &quot;<B>Web</B>&quot;
  <LI>Write a text-only (<A HREF="#rawHTML">or straight HTML</A>) note in
  your Notepad and file it in &quot;<B>Web</B>&quot;
  <LI>Name your note something distinctive.
  <OL>
    <LI>Make sure the names of the notes contain no punctuation marks. (.,:;&quot;$!?)
    <LI>The first word of the title of your note will be its virtual file name.
    That's not important except that you have to know NOT to let two notes
    share the same beginning word. In other words, a note named &quot;My Wife&quot;
    and one named &quot;My House&quot; will be indistinguishable to the server
    and may give you an error.
  </OL>
  <LI>Now, if you want to <A HREF="#advancedTopix">do fancy stuff </A>with
  your notes, read on. Otherwise, <A HREF="serve1.html">go try it out!</A>
</OL>

<H2><A NAME="advancedTopix"></A>ADVANCED TOPICS:</H2>

<H3>Spicing Up Your Notes with Embedded HTML Tags</H3>

<P>Since the server basically takes a note and encapsulates it in a HTML
frame, you can add hyperlinks and HTML formatting within your served notes
(without having to do <A HREF="#rawHTML">full blown HTML</A>) in order to
spice up the pages a bit. For instance, in your Note about your car, you
could reference a picture of it stored somewhere else by writing <TT><FONT
 COLOR="#330099">&lt;IMG SRC=&quot;http://my.other.site.com/username/images/mycar.gif&gt;</FONT></TT><FONT
 COLOR="#330099"> </FONT>and when your Notepad page is served up, the browser
will run off and fetch that image and nobody will be the wiser!</P>

<H3><A NAME="rawHTML"></A>Serving Raw HTML code</H3>

<P>New in version 1.2 of Notepad Server is the ability to serve straight
HTML code from your Web directory, allowing you immense flexibility in how
you present your information to the world. Couple your server, your creativity,
and <A HREF="http://www.tow.com/">Foundation Systems'</A> nHTML and you
have an un-beatable creation and service platform right in the palm of your
hand.</P>

<BLOCKQUOTE>
  <H3>So, How does it work?</H3>
  <P>It's blazingly simple to serve straight HTML. All you have to do is
  write the code in a note, being sure to follow the HTML spec by enclosing
  the whole document between <FONT COLOR="#330099">&lt;HTML&gt;</FONT> and
  <FONT COLOR="#330099">&lt;/HTML&gt;</FONT> tags. Notepad Server recognizes
  the <FONT COLOR="#330099">&lt;HTML&gt;</FONT> tag and serves the exact
  text of the page rather than doing any dynamic formatting of it.</P>
  <H3>Your Note Should Look Like This:</H3>
  <BLOCKQUOTE>
    <P><B><TT><FONT COLOR="#330099">&lt;HTML&gt;</FONT></TT></B><TT><FONT COLOR="#330099"><BR>
    &lt;HEAD&gt;&lt;TITLE&gt;</FONT><FONT COLOR="#000000">A Title</FONT><FONT
     COLOR="#330099">&lt;/TITLE&gt;&lt;/HEAD&gt;<BR>
    &lt;BODY&gt;<BR>
    </FONT><FONT COLOR="#000000">Insert Body Here</FONT><FONT COLOR="#330099"><BR>
    &lt;/BODY&gt;<BR>
    <B>&lt;/HTML&gt;</B></FONT></TT></P>
  </BLOCKQUOTE>
</BLOCKQUOTE>

<H3>Server Side Includes</H3>

<P>Also new in Notepad Server 1.2 is a series of variables that you can
access from either your text notes or, even better, your raw HTML documents.
On other platforms, these are called <B>Server Side Includes</B>, so that's
what we'll call them here.</P>

<P><CENTER><TABLE WIDTH="75%" BORDER="0" CELLSPACING="2" CELLPADDING="2"
HEIGHT="193">
<CAPTION ALIGN="TOP"><B>Current SSI's</B></CAPTION>
<TR>
<TD WIDTH="36%" VALIGN="TOP" ALIGN="RIGHT" HEIGHT="21"><P ALIGN=LEFT><FONT COLOR="#330099">&lt;TIME&gt;</FONT></TD>
<TD WIDTH="64%" VALIGN="TOP">Returns the Date and Time&nbsp;</TD></TR>
<TR>
<TD VALIGN="TOP" ALIGN="RIGHT" HEIGHT="34"><P ALIGN=LEFT><FONT COLOR="#330099">&lt;CREDITS&gt;</FONT></TD>
<TD VALIGN="TOP">Let everyone know what server software you're using!</TD></TR>
<TR>
<TD VALIGN="TOP" ALIGN="RIGHT" HEIGHT="34"><P ALIGN=LEFT><FONT COLOR="#330099">&lt;EMAIL&gt;</FONT></TD>
<TD VALIGN="TOP">Returns a hyperlinked mailto: of your email address.</TD></TR>
<TR>
<TD VALIGN="TOP" ALIGN="RIGHT" HEIGHT="21"><P ALIGN=LEFT><FONT COLOR="#330099">&lt;HOME&gt;</FONT></TD>
<TD VALIGN="TOP">Returns a Hyperlink to the default page</TD></TR>
<TR>
<TD VALIGN="TOP" ALIGN="RIGHT" HEIGHT="34"><P ALIGN=LEFT><FONT COLOR="#330099">&lt;NOTE_TITLE&gt;</FONT></TD>
<TD VALIGN="TOP">Returns the Newton's Name for the note being served.</TD></TR>
<TR>
<TD VALIGN="TOP" ALIGN="RIGHT" HEIGHT="34"><P ALIGN=LEFT><FONT COLOR="#330099">&lt;COUNTER&gt;</FONT></TD>
<TD VALIGN="TOP">Returns the value of nHTTPd's access counter</TD></TR>
<TR>
<TD VALIGN="TOP">&nbsp;<FONT COLOR="#330099">&lt;MOTD&gt;</FONT></TD>
<TD VALIGN="TOP">Returns nHTTPd's Message of the Day</TD></TR>
</TABLE>
</CENTER></P>

<H4>How do I USE These Things?</H4>

<P>Simple. Say you want to include the access counter in a sentence. You'd
write something like this in your Notepad:</P>

<BLOCKQUOTE>
  <P><TT>So far, <FONT COLOR="#330099">&lt;COUNTER&gt;</FONT> chunks o' knowledge
  have been spewed into the ether by this server.</TT></P>
</BLOCKQUOTE>

<P>And you'd get:</P>

<BLOCKQUOTE>
  <P><TT>So far, 296 chunks o' knowledge have been spewed into the ether
  by this server.</TT></P>
</BLOCKQUOTE>

<P>Or, say you always want the title of your HTML document to reflect the
name it has in the title bar of its Notepad entry. In you header, you'd
write:</P>

<BLOCKQUOTE>
  <P><TT><FONT COLOR="#330099">&lt;HTML&gt;&lt;HEAD&gt;&lt;TITLE&gt;&lt;NOTE_TITLE&gt;&lt;/TITLE&gt;&lt;/HEAD&gt;</FONT></TT></P>
</BLOCKQUOTE>

<P>And even if you changed the name of the note to Zaphod_Beeblebrox, the
title returned by your HTML will reflect that.</P>

<P>Nifty, huh?</P>

<H2>Special Characters:</H2>

<P>Unless you're lucky enough to use only the 0-127 ASCII code in your alphabet,
sometimes Notepad server would absolutely butcher your words when it came
to displaying umlaut characters, etc (such as &Auml;, &Uuml;, &Ouml;)</P>

<P>After some experimentation, I discovered how to reconcile the Newton
character set with the ISO standards and you'll have to give me feedback
on how it works. Basically, if a note is a regular Notepad note or if the
default page is being served up, we set the character set to ISO-8859-2
which causes these characters to display as they do in the Notepad, at least
in the browsers I tested it on. </P>

<P>If you write a straight HTML note, then the character set is NOT defined
for you. You may do so by including the following line in your HEAD after
the <FONT COLOR="#000066">&lt;TITLE&gt;</FONT>XX<FONT COLOR="#000066">&lt;/TITLE&gt;.</FONT></P>

<P><CENTER><TT><FONT COLOR="#000066">&lt;META HTTP-EQUIV= &quot;Content-Type&quot;
CONTENT=&quot;text/html; charset=ISO-8859-2&quot;&gt;</FONT></TT></CENTER></P>

<P>Depending on how this works out, we may add a default encoding pref to
nHTTPd that you can access via a SSI. We'll have to see.</TD></TR>
</TABLE>
</CENTER></P>

<P><CENTER>| <A HREF="start.html">Start</A> | <A HREF="serve1.html">Serving
Your Pages</A> |</CENTER>
</BODY>
</HTML>