Lets face it. Creating your template file and your source file is all well and good but if you don't put them together, then they are pretty much useless. Thankfully merging them is what the Hitop program does.
So how do we merge the files then? Quite simply, like this:
hitop source.hitop
When you run that, hitop will create a new file called source.html in the same directory. If you wish, you can tell hitop to give the file a different name.
hitop source.hitop source2.html
This will make a new file, this time called source2.html.
During compilation, Hitop will display any errors in the Hitop Markup - for
example it will tell you if you have forgotton to close your DEF
tags, or have called a procedure that doesn't exist (you may have mispelt the
name somewhere). If it finds any such error, Hitop will not create the new
HTML file.
Hitop will also display any errors in your HTML, which some people may find annoying. However, badly formed HTML can break in some browsers, so it's better to build your web pages with valid HTML. Hitop will however create your new HTML file.
While you could have a seperate template for each page, it doesn't really
make much sense. You're more likely to want to give a uniform design to many
designs. This is easily done by just having <@FILE
SRC="templatename"> at the bottom of each source file, where
templatename is the name of your template.
However, creating multiple files using the above method, isn't particularly easy. This is where a Makefile comes in usefull. Many moons ago, Darren Edmundson posted a sample Makefile onto the usenet, and it is his that we will use in this tutorial. You can view the Makefile here.
There are two lines which are of interest to us. The first is the line that
says HTMLFILES =. After the equals sign you list all the HTML
files you wish to create. This is the name of your source file, with the file
extension replaced by html.
The next line is TEMPLATES = . This line lists all the files
with the hitop file extension that you do not wish to be made into HTML files.
Template files are a good example of these.
In both cases, you will be able to fit more than one entry on one line. However, if you have lots of files, put a backslash ( \ ) at the end of the line and continue on the next line. For example:
HTMLFILES = source1.html source2.html \
source3.html
source4.html
And that's all there is to it. You should now be able to create multiple files using Hitop, using one template. Tada!