to the weblog
back to the front page
makeWeb
an ugly website generator written in
Perl On May, 13th 2004 a friend told me that he is looking for a script that generates the HTML pages of a homepage out of some kind of sources files that are easy to write. I mentioned that I wrote something like that a year ago. He was mildly interested and so on the evening of that day sitting in the AKK and listening to the music of the Akkustik-Karaoke Schlonz I took the skin module generateHTML.pm I had written for use in mwiki in the first half of the year 2002 and worte a Perl script called makeWeb.pl that iterates over a file system structure and produces an (hopefully) nice looking website. Please note that this program is only some kind of a prototype. You will have to change this and that if you actually want to use it. (In case you intend to do this read the final remark at the end of this page.) Examples
The file system structure that is source of the above examples can be found here. File format of the source files.txt files are interpreted as structured text, i.e. a handful of replacement rules specified by regular expressions are used on them. Such a file might look like this. .html files are directly inserted as the body of the template structure defined in the skin. Here is an example file. (Although the latter is not a complete HTML file most likely your web browser will interpret it as such. In that case you will have to instruct it to show you the "source" of the page.) The list of tags that are interpreted by the structuredText module is to be found in this document under the topic Liste der "structuredText-Tags". (Sorry, this text is only available in German.) Download
Final remarkPerl is just so unbelievable ugly! Now as programmed in Common Lisp during the last months I cannot believe that only two years ago I actually liked Perl. (No offence meant. :o)) To generate the pages of this homepage I actually use the following very simple shell script. The source files are the bare bodies of the pages. #!/bin/sh for i in *src; do echo $i; { cat header.html.inc head -n -1 $i head -n -5 tail.html.inc tail -n 1 $i tail -n 4 tail.html.inc } > ${i%%src}html chmod og=r ${i%%src}html mv ${i%%src}html .. done Max-Gerd Retzlaff <m.retzlaff@gmx.net>, <mgr@bl0rg.net>, or <mgr@vantronix.net>
GnuPG- / OpenPGP-Information: Type bits/keyID Date User ID pub 1024/81239F12 2002/03/12 Max-Gerd Retzlaff <mgr@hannover.ccc.de> Key fingerprint = 49 CD 21 F2 41 AC 72 C5 D0 D1 27 DC C2 B2 48 AE 81 23 9F 12 uid Max-Gerd Retzlaff <m.retzlaff@gmx.net> sub 4096g/63E36E39 2002-03-12 local copy of the key
First version on June, 13th 2004. Last modified: Sun Jun 13 06:12:17 CEST 2004
|