two passes | project | technical | examples | links | # |
project - summary - tutorial (2) (3) (4) (5) (6) (7) (8) (9) - usage (2) technical - reasoning - two passes - still tiny - sitemaps - variables - accessibility WAI SubSects examples - horizontal - vertical - tabbed (2) - multi section - printer style links - some hints - faq&issues - all features # - about me - our sitemap - download
(C) 2004-04-22 |
using two passesLately I did convert the original MKSITE.SH script into an original twopass model and this is the first version of the mksite idea that I want to publish to a wider audience. Previously the site.html was put as the last "href" in the navigation bar - each file being processed would also register some meta information to sitemap input file that would be used to generate the site.html sitemap. Now the meta information detection is seperated out to its own pass which does not do anything on output. The per-file meta information can be looked at in a file named "target.html.~~" and the global meta information is found in "-mksite.~~". The ".~~" was chosen since my `make clean` rule usually has an entry `rm *~` so it would also clear out any remainings of the MKSITE.SH runs. Furthermore, many gnu filetools do not list any "backup" files which are recognized via a "*~" pattern. When all meta information has been parsed then the second pass can start off which will look at the same files again that were also seen in the first pass. For each file we generate two sed scripts - a file "target.html.~head~" and a file "target.html.~body~". The two scripts are then combined with as simple a run as sed -f target.html.~head~ site.htm > target.html sed -f target.html.~body~ target.htm >> target.html Therefore the main intelligence lies in making of the sed scripts. You can easily implant your own functionality in that model, just invent something that can be expressed in terms of an sed line with an anchor expression and and edit definition. The functionality present can be a guide to your stuff. The functionality already present will include things like
|