From "Jahn Tue Aug 27 16:13:49 1996 Article: 90557 of comp.infosystems.www.authoring.html From: "Jahn Rentmeister"
Subject: Preprocessors for HTML Date: 23 Aug 1996 15:30:09 +0200 Organization: Westfaelische Wilhelms-Universitaet Muenster, Germany Many HTML documents contain redundant information that is supposed to be consistent over a set of documents. Common examples are: Navigation bars, common background colours/images, footers, headers (w/ logos) etc. The natural approach for managing this redundancy was to use a preprocessor. In fact, I wrote my first HTML preprocessor _before_ I wrote my first HTML document. This preprocessor was, well, not at all perfect. By now, I have looked at a lot of other preprocessors for HTML. I am interested in the experiences of other people who have uses preprocessors, or who have deliberately decided against using one (after considering it). To begin with, I'll share some of my experiences: Basically, there are 3 different classes of preprocessors: 1) Preprocessors that uses a syntax that clashes with HTML. (e.g. sheep, htmlpp, htm4l, GTML) You can not simply take a HTML document and convert it with "nearly no" effort to a preprocessed document. 2) Preprocessors that use a syntax compatible with SGML. (e.g. hmml, htmlscript, spml, SGML-normalizers) You can verify your syntax with SGML-parsers, if you provide your own SGML. This can have benefits. 3) Preprocessors that use a syntax orthogonal to SGML/HTML. (e.g. HTML++, PHP/FI if used as a preprocessor) These use syntax such as < > or code > to embed things in HTML documents. There are also different functionalities provided by different preprocessors: 1) Simple macros, no parameters (HTML++, SGML-normalizers (entities), GTML) 2) Macros with parameters (most) 3) Special features: Document classes and inheritance (HTML++), on-the-fly definition of new tags (hmml), variable manipulation (PHP/FI, hmml, htmlscript, spml), conditional code (PHP/FI, hmml, htmlscript, spml) I have hardly any knowledge on SGML, therefore I do not know how fine preprocessing can be using sgmls/SP etc. I am very impressed by HTML++ and hmml. HTML++ is missing macros with parameters, but all preprocessors except HTML++ are lacking the OO-like design facilities that HTML++ provides: E.g. assume you have common navigation bars everywhere. Using a normal preprocessor, changing that navigation bar in all of your documents is easy: Change the definition, type make, done. But with HTML++, you could also change the _position_ of that navigation bar on all of your pages: Move it from below the logo to the top of the page etc. You just change your definition of what a page should look like, type make, done. I am looking forward to the knowledge, experiences and proposals that others might have on this topic. I myself use sheep (for solely historical reasons) and HTML++ (for better reasons). And I expect interesting things to come from both HTML++ and hmml. References: GTML: This is a perl-script for preprocessing HTML, similar to the C preprocessor, but without parameters for macros http://www.firststep.com.au/software/ http://www.q-net.net.au/~gihan/gtml.html Contact: email@example.com, firstname.lastname@example.org, (Gihan Perera) HTML++: This is a perl-script, it uses lots of memory, allows OOP-like object hierarchy for pages http://www.infosys.tuwien.ac.at/HTML++/ spml: part of the spinner HTTP-Server, I don't know whether stand-alone implementations are available. http://fang.fa.gau.hu/(nobg)/www/spinnerdoc/spml/ htmlscript: commercial preprocessor http://htmlscript.volant.com/ hmml: C++-implementation, GPL, allows on-the-fly tag definition. http://dcpu1.cs.york.ac.uk:6666/~james/hmml.html Contact: email@example.com (James Carter). PHP/FI: Intended as a CGI-wrapper, but abuse for preprocessing is possible http://www.vex.net/php/doc.phtml sgmls/SP: SGML-parser/normalizer. I have no experience with them http://www.jclark.com/sp/index.htm htm4l: m4-utilization for HTML http://www.teclata.es/terry/htm4l/htm4l/ Contact: firstname.lastname@example.org (Terry Jones). Orb: a shareware tool for DOS, OS/2 http://www.cinenet.net/users/cberry/orbinfo.html Contact: email@example.com (Craig Berry) sheep: a rather un-released, basic, ill-coded preprocessor I coded myself. Use if you dare running my code. (source comments in german - the language I use when I talk to myself) http://www.uni-muenster.de/WiWi/home/rentmei/sheep.c -- http://www.uni-muenster.de/WiWi/home/rentmei/
__________________________________________________________________References updated and email contacts added: MS, CERN 24 July 1997