[Prev|Next|Home] Posted 1/28/95 by userland@hotwired.com

Text Processing and Macros

Text Processing and Macros

As AutoWeb flows text from the Input Folder to the Output folder, it makes email addresses and URLs hot, and it expands macros, allowing you to link to FTP files, other websites, and include inline graphics in your pages.

All macros are in the form of [<macroname (params)>]. The names that are directly supported in AutoWeb 1.0 are "link", "pic" and "ftp".

link

"link" creates a hyperlink from your page to another page in the web. It takes two parameters, the URL you want to link to, and the text that will appear underlined on your page.

Here's what a link macro call looks like:

[<link ("www.infi.net/cool.html", "Cool Site of the Day")>]

Here's what it does:

Cool Site of the Day

pic

"pic" takes one parameter, the name of a GIF file in your Gif Folder.

Here's what a pic macro call looks like:

[<pic ("okeefe")>]

Here's what it does:

ftp

"ftp" takes three parameters, the name of a GIF file displayed next to the FTP text, the name of the file you want to be downloaded when a reader clicks on the link, and the text you want underlined on your page.

Here's what a ftp macro call looks like:

[<ftp ("camel", "naked.sit.hqx", "Are You Naked?")>]

Here's what it does:

Are You Naked?

A small file downloads that does something neat if you double-click on it with LSE 1.0b5 or greater running.

Note: AutoWeb does not automatically upload files for FTP downloading. I use Fetch 2.1.2 to upload files to my FTP server site. Make sure that user.web.ftpURL is set to the correct value in your Config Script.

Other Verbs

You can actually call any built-in Frontier verb within a macro, so this feature is potentially much more powerful. As a safety precaution -- on an experimental basis -- the scanner only allows expressions containing no more than one level of parentheses.

Here are some examples of macro calls and the resulting text:

[<user.web.sysopName>] = AutoWeb Docs Writer

[<clock.now ()>] = 3/23/95; 12:27:41 PM

[<random (0, 1000)>] = 119

[<states.nthState (18))>] = Louisiana

[<"There are " + sizeOf (system.agents) + " agent scripts running.">] = There are 9 agent scripts running.

There's even an error-reporting mechanism built-in:

[<12 / 0>] = ERROR: "Can't divide by zero."

[<11 + 12 - hello>] = ERROR: "Can't evaluate the expression because the name "hello" hasn't been defined."

[<states.nthState (random (0, 50))>] = ERROR: "Illegal embedded command. It could be too complex and it could be dangerous!"

Note that all these calls execute at the time your pages are rendered as AutoWeb is rebuilding your website. In other words, they run at "build-time."

Special Hacks

I'd call this special characters, but it seems more like a special hack. I need feedback on this one...

How to get an at-sign into the text?

I thought it would be provided for in HTML, but it seems not. I checked the authoritative source, CERN, but didn't see anything remotely like a @ anywhere in sight. So I did something hackish. I'm not saying what it is yet. If anyone has any ideas, please send mail to dwiner@well.com.

[Note: atsigns are a problem because they are the key that the scripts use to recognize an in-line email address.]



-Surface Links-

AutoWeb 1.0 Docs
AutoWeb & Beyond


userland@hotwired.com
© copyright 1995 UserLand Software, Inc. All Rights Reserved.