![]() ~ENDIF>![]() ![]() ![]() ![]()
|
1. Overview
1.1 Why AutoHTML?
1.2 Warnings Just remember: Back up your files and make sure all your files are from a trustworthy source.
1.3 The Story But I wanted to have nifty navigation bars on the sides of my pages that were the same through out. And it was such hard work going to every page and changing the nav bar every time I decided to add another segment. "Wouldn't it be nice if there was a program, which took bits of HTML and combined them together into one large HTML file?" I thought, "It could have simple conditional evaluation so that the currently viewed file was removed from the navigation bar and there could be flags to adjust the content." So I began programming. The first version contained about 180 lines of C-code and had seven commands that could be embedded into a file. And it was good. It pulled together header.htm and navbar.htm and footer.htm along with many content files to create a nifty-looking site. But C leaves much to be desired in the ways of string processing, so it was difficult to update and relied on many cheating tricks. But there was yet hope! One year after autohtml.c was created, I knew Perl. and so was born ahtml.pl. Filling nearly 400 lines of code, it contained 16 commands along with a number of command-line switches and the ability to seek out the files it was to parse on its own. And it was even better. PHP files are created and navbars were generated which had links to the most recently updated file! And thanks to the power of Perl's built-in regex operators, modifications were easy, and the tags could have readable names like LINEIF rather than IFU But towards the end of September, a new problem developed. ahtml.pl was fond of inserting whitespace. Commands turned into space characters and blank lines were everywhere. Ordinarily, HTML ignores whitespace, but in MSIE the whitespace caused images to be incorrected separated. And that caused me to rewrite the parsing engine into a character-by-character parser. After several sodas, much "WHEN DID THAT CHARACTER BECOME A STRING?"s and general bafflement at the mysterious and arcane workings of Perl, it was finished. ...all that work just so I wouldn't have to copy & paste a few lines whenever I started a new html page. |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~