decorate.pl/menuize.pl
|
|
Using decorate.pl/menuize.pl to create your web pages
You can download the original version from http://www.xs4all.nl/~evbergen/openradius/index.html
First create a directory tree like this:
document_root/src <-- create your bare html pages
/tmp <-- used for tmp files
/tools <-- executable tools
Basically, you start out with writing bare HTML pages such as you'll find
in the 'src' directory take for example this page. If you look at the source
for that page, you'll see some special comment tags:
<!-- DECO TITLE = "E-Advies / Emile
van Bergen"
DESCRIPTION =
"Emile van Bergen / E-Advies consulting - Developing"
KEYWORDS
= "Emile van Bergen" -->
<!-- MENU PARENT="E-Advies" TITLE="English" URL=FILE -->
The idea is that you feed these pages containing pseudo tags that tell
the scripts what to do, first through decorate.pl, creating temporary pages
such as the ones you find in http://www.xs4all.nl/~evbergen/tmp/, for example
http://www.xs4all.nl/~evbergen/tmp/e-advies-home.html. You see there the
decorared page, without the <!-- DECO --> pseudo tags, but with the
<!-- MENU--> ones still present.
You'll also notice an
<!-- INSERT_MENU -->,
which is part of the template in decorate.pl.
The last step is feeding the pages in the correct order through menuize.pl,
which builds a tree-like menu from the 'PARENT' attributes in the MENU tags,
and inserts the generated menu with the correct item selected in the place
of
<!-- INSERT_MENU -->
producing the final output.
Here is the script I use to run the whole process for my site named for
example "runhtml":
#!/bin/sh
# script "runhtml"
#
# clean up
rm -f *~ src/*~ tmp/*~
#
tools/decorate.pl src/* tmp
#
tools/menuize.pl tmp/home.html tmp/decorate.html tmp/menuize.html tmp/template.html
.
#
I run this from the base directory of the site. The first command decorates
all the files in src/, creating output versions in tmp/. The second command
takes the files in tmp/ together, in the right order, generates the menu,
and outputs the complete versions in the current (.) directory.
So the command line for both script is
script.pl sourcefiles destinationdirectory
© Michael Meifert
Generated on Wed Feb 15 20:24:36 2017 by decorate.pl /
menuize.pl
|