WRITING WEB PAGES

THE BASICS:

  1. Create a folder in your Notepad called "Web"
  2. Write a text-only (or straight HTML) note in your Notepad and file it in "Web"
  3. Name your note something distinctive.
    1. Make sure the names of the notes contain no punctuation marks. (.,:;"$!?)
    2. 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 "My Wife" and one named "My House" will be indistinguishable to the server and may give you an error.
  4. Now, if you want to do fancy stuff with your notes, read on. Otherwise, go try it out!

ADVANCED TOPICS:

Spicing Up Your Notes with Embedded HTML Tags

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 full blown HTML) 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 <IMG SRC="http://my.other.site.com/username/images/mycar.gif> and when your Notepad page is served up, the browser will run off and fetch that image and nobody will be the wiser!

Serving Raw HTML code

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 Foundation Systems' nHTML and you have an un-beatable creation and service platform right in the palm of your hand.

So, How does it work?

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 <HTML> and </HTML> tags. Notepad Server recognizes the <HTML> tag and serves the exact text of the page rather than doing any dynamic formatting of it.

Your Note Should Look Like This:

<HTML>
<HEAD><TITLE>
A Title</TITLE></HEAD>
<BODY>
Insert Body Here
</BODY>
</HTML>

Server Side Includes

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 Server Side Includes, so that's what we'll call them here.

Current SSI's

<TIME>

Returns the Date and Time 

<CREDITS>

Let everyone know what server software you're using!

<EMAIL>

Returns a hyperlinked mailto: of your email address.

<HOME>

Returns a Hyperlink to the default page

<NOTE_TITLE>

Returns the Newton's Name for the note being served.

<COUNTER>

Returns the value of nHTTPd's access counter
 <MOTD> Returns nHTTPd's Message of the Day

How do I USE These Things?

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

So far, <COUNTER> chunks o' knowledge have been spewed into the ether by this server.

And you'd get:

So far, 296 chunks o' knowledge have been spewed into the ether by this server.

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:

<HTML><HEAD><TITLE><NOTE_TITLE></TITLE></HEAD>

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

Nifty, huh?

Special Characters:

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 Ä, Ü, Ö)

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.

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 <TITLE>XX</TITLE>.

<META HTTP-EQUIV= "Content-Type" CONTENT="text/html; charset=ISO-8859-2">

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.

| Start | Serving Your Pages |