NPDS is designed to generate and serve Web content without your having any knowledge of HTML or Newtonscript, but it's also able to act as a much more traditional HTTP server in that if Notes you store in your selected WWW folder are written in strict HTML* they'll be served as "files" without any significant changes in their formatting or content.
* NPDS automatically detects whether a page is HTML or plaintext by looking for the presence of any of the following tags: <HTML>, <HEAD>, <BODY>, <FRAMESET>. You can, of course, fool the parser with a phony tag, but why would you want to do that?
Although your Notes may indeed be HTML files, they don't have to be named according to traditional file-naming protocols since NoteServ doesn't usually use the file name to retrieve a given Note. (Appendix: The NPDS Pseudo-Filename System covers how NPDS handles files and folders)
Example:
If you have a note about your train collection and it's written in HTML because you need a nicely formatted table of all the types of engines you have, you can name the Note "My Train Collection" and that's perfectly OK. Its URL when displayed in the list of Notes will be something like /html/123456$007.nsd where "123456$007.nsd" is a special identifier NPDS uses to retrieve your particular Note.
Now, there's a neat trick you can do here... the Note is actually a container for a HTML object. What this means is that you write out your HTML page, give it a title between the <TITLE></TITLE> tags, then turn around and give the Note that contains it another title, quite likely the same one you put in the HTML.
If you want to logically link these two titles, put the following Server Side Include (SSI) <NOTE_TITLE> in between the <TITLE> tags in the HTML. When the page is served, the Note title will be substituted into the space between TITLE tags.
In our "My Train Collection" example: A note containing the HTML document is made. In the HEAD of the HTML doc is this code: <TITLE><NOTE_TITLE></TITLE>. The Note is titled "My Trains Collection." Now when the page is served, the name of the Note is substituted in place of the Server Side Include: <TITLE>My Train Collection</TITLE>
As you've seen with the previous example, serving Pages and Data from your Newton doesn't have to be a static experience. You can create living, dynamic documents by writing into your notes variables called Server Side Includes (SSI). These variables are detected when a Note is served and substituted with specific data. You can put in variables for things as mundane as your name and email address to things a bit cooler like your daily schedule! You can also use SSI to access the NPDS formatting preferences. In later sections, you'll even find that you can write Newtonscripts to create your own custom SSI.
To use any of these extensions to standard HTML, enclose them in < > like so <CUSTOM_TAG>
User Data | Content Variables | Preferences | Paths
USR_POST: Postal Zone |
USR_REGION: Current State/Province |
TIME: Current Date/Time |
USR_TELE: Default Telephone |
EMAIL: Current Default Email Address as mailto: hyperlink |
USR_CITY: Current City |
USR_NAME: Name of Current Owner |
USR_ADDR: Current Street Address |
|
NOTE_LIST: List of Notes Filed in your selected WWW folder |
POST_LIST: List of Notes posted via the WWW |
NOTE_POST: Insert a link to /html/postnote.html where you
can post Notes to your Newton from a browser. |
NAME_SEARCH: Inserts a form for searching the Names database. |
AGENDA_DAY: Inserts a table containing the day's Events, Meetings, ToDos. |
NOTE_SEARCH: Inserts a form for searching the Notepad and returning a ranked list of hits. |
NOTE_TABLE: Table view of Notes sorted in ascending order by creation date |
POST_TABLE: Table view of WWW-posted Notes sorted in ascending order by creation date |
EVERY_TABLE: Table view of Both WWW-posted and Your Notes sorted in ascending order by creation date |
EVERY_LIST: List of Both WWW-posted and Your Notes |
|
|
DEF_FONT: Font face defined as default |
DEF_SIZE: Default Font Size |
|
DEF_COLR: Background color |
HI_COLR: Preferred Background Highlight color |
MOTD: Admin's Message of the day to his/her visitors |
HOME: Inserts a hyperlink to the page defined by admin as the "Home" page. |
INSULT: This is a special treat for you, Thou artless, beef-witted hedge pig. |
COUNTER: Hit Counter |
NOTEPAD: Returns a link to NoteServ's /html/index.html |
CALENDAR: Returns a link to DateServ's /dates/index.html |
CARDFILE: Returns a link to the CardFile Server default page /cards/index.html |
PAGER: Returns a link to WebPager's form-based paging interface (/pager/index.html) |
CFG: Returns a link to the NPDS Administrator page |
|
Real World Example: You've written some pages in HTML and you want want the email address that associates with your current owner card available on each page. Since you have 5 email addresses, this could be a problem, except that you know about the <EMAIL> tag. Insert it where you want your email address to go and the address will always be that of the current owner of the Newton.
Writing You Own Custom Server Side Includes:
Version 2.0 of NPDS contains the Simple Scripting Architecture which allows you to write Newtonscripts that return substantial chunks of text and can be inlined into any NPDS Content by assigning then their own Server Side Includes. For more details and some examples, see the manual section on the "Simple Scripting Architecture".
When a client accesses the /html/ directory, NoteServ (actually most HTTP servers do) serves a built-in file called "index.html". You can easily over-ride the "index.html" that NoteServ delivers, though. Here's how.