Website Scripting with Frontier 4.0
I've always wanted to build websites entirely within the Frontier environment. I felt that the hierarchic nature of Frontier, and the tools it offers -- the outliner, structured tables, data storage and text storage, and a powerful scripting engine tha connects to lots of apps and controls the local OS -- would be a good match for the worldwide web.
It was a puzzle, an an elusive solution. I iterated a bunch of times, first there was AutoWeb, then Clay Basket. Each step was more powerful and better tuned to the way people build websites. Now I'm doing my website development entirely within Frontie . This page and its related pages document the new approach.
Setting up a new website
Cmd-J to user.html.sites. You'll see two sub-tables, localTest and ftpTest; the first table describes a site that's accessible on my local area network via file sharing, and the second is one that can only be accessed thru FTP file transfer. Which kind of site do you want to create? Copy/paste the appropriate table, rename it, and open it. Prepare to edit!
If your site is local, set isLocal to true, and set folder to point to the local folder that you want Frontier to create files in. Set url to the web URL for this site. In the future, Frontier will use this value to build links to this site from other ites.
If your site is accessible via FTP, set isLocal to false, and set account, password, domain, directory, to describe the FTP site. Set url as described in the previous paragraph.
Cmd-S to save your changes. Take a breath. Close user.html and its sub-tables. Onward!
Writing some text
Cmd-J to user.websites. Create a new table, press cmd-Return, enter its name, something short like site1 or firstSite, press Enter. 2click on the wedge next to the line to open the table.
Frontier waits for you to type the name of the first cell in this table. Let it wait for a minute.
The name you enter here will be the name of the file that Frontier creates. If WebStar is your web server, you'll want to call this cell default, so it will create a file called default.html. Most other web servers do something special with index.html, so if this text is going to one of those servers, call it index.
So, back in Frontier, enter the name, default or index, or whatever, and press Enter.
2click on the wedge next to this cell and Frontier will ask you for the type of the object. Here's something very cool -- it can be a WP Text object or an outline. In the future it will be possible for it to be a table or a script, or anything. It'll b very cool! Right now it's just cool. ;->
Keep it simple for now, make it a WP Text object, click on the Zoom button and enter some text. Something simple like "Now is the time for all good men to come to the aid of their country."
Cmd-S to save changes. Please leave this window open and in front for the next steps.
See what it looks like
Launch a compatible web browser, Netscape Navigator or Microsoft Internet Explorer.
In Frontier, choose View in Browser from the Net menu.
If all goes as planned, the browser comes to the front and displays the text of your WP Text window. It should look like one of the pages in the www.scripting.com website.
Adding directives
We can improve the look of the page, and tell Frontier where to store the rendered page by adding three directives at the beginning of the text.
Each directive line begins with a pound sign, followed by a directive name, a space, then an expression that determines the value of the directive.
Three directives are supported in Frontier 4.0b6 -- #title, #template and #ftpSite.
- #title determines the title of the HTML page. If you leave it out, it defaults to the object database address of the window. Add #title "My First Page" at the top of the text and choose the View in Browser command from Frontier's Net menu. The titl of the browser window changes to My First page as does the page's headline.
- #template determines which template is used to build the page. Look in user.html.templates for examples. Add #template "scriptingcom" to give your page the look of one of the www.scripting.com pages.
- #ftpSite determines which FTP site will receive the built pages. You've already set up your own site in the first part of this tutorial. Add #ftpSite "yoursitename" at the top of the window.
Macros, the glossary, etc.
All the features of the BBEdit website scripting package are available to you in this environment, glossary entries, macros, auto-enabled links, international character substitution. I plan to integrate the docs for this package and the BBEdit package. For now, check out http://www.scripting.com/bbedit/ for an explanation of these features.
Releasing your page
The normal process for getting a page or a site together is to iterate over the look and content of the page until you're ready to let other people read it.
If your site is accessed thru FTP, launch a supported FTP client, Fetch or Anarchie. Then, in Frontier, open the window containing your HTML text, and choose Release Rendered Page from Frontier's Net menu.
If you use Internet Config, you can set it up so Frontier automatically launches the correct FTP client by setting the FTP helper app to Fetch or Anarchie.
If there are problems, check the #ftpSite directive at the top of the text. Check the user.html.sites table to be sure your site is there. Look in the table. Review the instructions for setting up your site table, be sure the fields are consistent.
If your site is local and there are problems, be sure the volume containing the folder is mounted on your desktop, that you have writing access to the server, and that the server is accessible thru the Finder.
Notes
The Places submenu of the Net menu organizes all the new important tables in Frontier 4.0.
Two types are supported in Frontier 4.0b6, wp text and outlines. For outlines add the directives as top-level headlines at the top of the text. They are stripped out by the html suite. To see how directives are implemented check out html.data.standardM cros.renderobject. I want to add support for other types. Tables will be interesting. Scripts will be even more interesting. Tables with scripts totally boggle the imagination.
Use the scripts in the Net menu as a starting point for your web scripting activities. You can call html.buildPage or html.ftpPage from your own scripts. The commands in the Net menu are just the interactive way of doing things that can easily be combi ed into more powerful operations from your own Frontier scripts.
As of Frontier 4.0b6 the #directives are not processed when the text comes from BBEdit. I plan to erase this limit in the next release and integrate the docs.
![]() |
This page was last built with Frontier on a Macintosh on Wed, Apr 24, 1996 at 9:38:06 AM. Thanks for checking it out! Dave |