This page works with your old browser, but a free web standards browser is much more fun:

mbs

m b stevens . . .

...

New Jewelry

Older Jewelry

--

Extra

Info

PREPROCESSOR

This page: Copyright (C) 2004 by Michael B. Stevens, all rights reserved. The preprocessor suite is under Gnu public license

WHY PREPROCESSING?

Usually, many pages on a website contain common elements, (menus, logos, headers, footers, document type, and links to a common CSS file).

You can cope with this by using cut-and-paste with a text editor, by using SSI (server side includes), or by generating the pages with a server side language like Perl or PHP. I generate a lot of pages on my sites with Perl as a server side language, but also find preprocessing extremely useful.

Another reason to preprocess is to avoid having to use html frames. Frames are EVIL. Why? See: here and here. This suite is also a good tool to help transform old framed sites from frames.

Preprocessing is easy, and allows you to change the look and content of a whole site easily. Here are the steps:

  1. Create text files that will be combined to make the pages. This is the part that takes a bit of thought: Exactly where do I want to split these files so that when they are combined they will make a valid HTML or XHTML page?
  2. Run one or both preprocessor scripts over these text files to create finished HTML or XHTML files.
  3. Upload the newly changed (X)HTML files to your web space while you go drink a cup of coffee and give yourself a big pat on the back.

It's all very easy and quick, and you can do the whole thing again tomorrow if you have a new idea about how the site should fit together.

Concatenate (join) files together:

mcat.pl reads a file that describes how you want your site constructed. Each line of that file instructs mcat.pl how to join several files into a final file (usually '.html' or '.mflt', but any name is fine). On each line you simply list the files you want to concatenate, in order, followed by the name of the final preprocessed file. You can do the basic structure for a whole site like this in minutes. (New: For programmers, a Perl module of this script is available at CPAN which will allow you to add the functionality of this script to your Perl programs with three lines of code. It is named File::MultiCat there.)

Filter / Replace

mflt.pl reads '.mflt' files looking for special commands. It obeys those commands when it writes an '.html' file based on the '.mflt' file. With these commands you can include files, datestamp your pages, and perform a number of other functions. The mflt.pl script searches an entire directory tree for '.mflt' files.

This really is a simple package to use. You can use one program or both to preprocess your web site. The 'README' file that comes with the package has all the information you'll need. There are also some examples. Notice that all this happens on your own computer. You need no server programming privileges whatever. Just preprocess your pages and load them to your website.

Download

For other operating systems: Since the program is in Perl, just download the version that you have a decompression tool for; it will probably work. Please send reports of any problems.

You also need Perl

No computer should be without Perl anyway; Perl rocks! It is an amazingly powerful language. There are links to Perl sites and tutorials at my web portal. Pull down the menu and choose "CGI/Perl".

Cheers, Michael B. Stevens -- ENJOY!