WRITING WEB PAGES

Although your Personal Data Sharing is delightfully simple to use, it's also quite powerful for a PDA program. You have the option of serving up plain text notes, mixed HTML/plain-text notes, or raw HTML code. In addition, you have the ability to now provide a custom default page for your Notepad Server.

THE BASICS:

  1. Create a folder in your Notepad called "Web" then write or file any number of text-only notes in this folder.
  2. Or, you can install Notepad Setup, which will ensure you have a proper "Web" folder and install two example Notes in that folder (index.html and About Personal Data Sharing)
  3. Name each note, following these rules:
    1. Make sure the names of the notes contain none of these characters
      ? / , " : + > <
    2. Don't name any note except for a very special one "index.html"
    3. The file name parser uses the first word of each note title as the virtual filename. Select distinct names for your notes keyed by the first word of the title.
      Example: "My Server" and "My Cat Farm" both evaluate to "My" in a URL request. Either change the name of one note or do concantenate the words using an underline character like so "My_Server" and "My_Cat_Farm"
  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

Since version 1.2 of Notepad Server you've had 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 supported by Personal Data Sharing 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.

A Table of all SSI supported in Version 1.5 of Personal Data Sharing is available here.

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, you need to be able to display "International Characters" (such as: ü, ø, å, ß)

One solution to this is to go through your notes and subsitute in the &#000 HTML code for each character and we tried to have PDS do that that but it's VERY annoying. (Slow, inaccurate, and generally stupid.)

So, we developed a compromise: Unlike 90% of the world's HTTP servers, we have chosen to follow the RFC 2068 standard for HTTP 1.1 Servers and provide a way for the browsers to interpret these characters AS TYPED by setting what's called the charset token in the server's message headers. We also include the same data in a <META> tag in the HEADER of any generated HTML pages. This helps the browser decide what encoding to use when viewing your page.

Here's a Sample Header From nHTTPd to Illustrate:

HTTP/1.0 200 OK
Server: nHTTPd/1.5
Content-type: text/html;
charset=ISO-8859-1
Content-length: 1024

In nHTTPd Setup, you can select from any of these MIME charsets or None to turn off this option entirely.
Depending on demand, I may add other encodings.

charset Selections:
ISO-8859-1: The WWW Standard
ISO-88259-2: Better for European Characters
X-MAC-ROMAN: The Standard MacOS Set
US-ASCII: The 0-127 Character Set
None: No charset token is presented

When I first introduced this feature with Notepad Server 1.2, I suggested that you add by hand into your raw HTML the <META> tag containing the charset token. That is no longer required as this data is provided in the server's message header.

| Start| Serving YourPages |