Download presentation
Presentation is loading. Please wait.
1
Department of Computer Science Homepage
HTML Preprocessor Perl Database Revision Control System Introduction: My name is Leonhard Jaschke, I am working at the Institute of Scientific Computing at ETH Zurich. Recently I was responsible for the development of a new version of the WWW site for the Department of Computer Science. I just want to show you during this talk the main concepts we used for this project. For our homepages we use an HTML preprocessor, a small database written in Perl and RCS, the revision control system we had available on our UNIX platform server. © 1998, Leonhard Jaschke, Institut für Wissenschaftliches Rechnen
2
HTML Preprocessor htmlpp (1)
Department of Computer Science Homepage HTML Preprocessor htmlpp (1) What is it? Must run before people can access the HTML files (automized by makefiles) Provides additional tags Conditional execution of HTML code Language specific execution of HTML code Definition of macros Include of other PreHTML files User client HTML The most important concept realized in the new homepage is the usage of an HTML preprocessor. What’s that? An HTML preprocessor is a program that must run to produce the HTML files. It provides a language extension to HTML, e.g. tags for the conditional execution of HTML code, in particular language specific execution of HTML code, definition of macros (e.g. frequently used URLs) and tags for the inclusion of other so called PreHTML files. On the right side of the slide you have a schematic view of how it works: From the PreHTML files the preprocessor generates the HTML files that can be accessed by the user with a browser. This technique has also the advantage that you can edit your PreHTML file just as long as you want. Your alterations to the HTML file will not be accessible by the world until you run the preprocessor. PreHTML © 1998, Leonhard Jaschke, Institut für Wissenschaftliches Rechnen
3
HTML Preprocessor htmlpp (2)
Department of Computer Science Homepage HTML Preprocessor htmlpp (2) Why do we use it? Language control (German, English) Automatic layout: header, footer, date Include frequently used information Where can I get it? Freeware by Nicolas Thiéry with GNU license Written in Perl runs on every computer that runs Perl (Unix, PC, Mac, ...) Current version at Why did we decide to use it? The most important problem in our old pages was that German and English pages did not contain the same information. With the HTML preprocessor the English and the German information is stored in one PreHTML file, so that the administrator has to change only one file, when certain information changes. Link and layout information has to be changed only once, as long as it affects both language versions. Layout components that affect all pages like headers, footers, button bars ... can be automatically included. The behavior of those included files can also be controlled by parameters. This way it is easy to put a history list into the header without using any browser proprietary script language. The possibility of includes is also used in our pages to reuse frequently used information, e. g. the address of the Department’s head is only stored once in an include file, but appears in several pages. Where can we get this thing? We used the program htmlpp by Nicolas Thiéry. It is Freeware with a GNU license, written in Perl (which is available on nearly any platform) and therefore portable. Conditions of use include a URL somewhere on the page to the URL of the preprocessor, sending a mail with the URL of the created web site to the author, and not to use htmlpp to make money. © 1998, Leonhard Jaschke, Institut für Wissenschaftliches Rechnen
4
Perl Database ERM-Model Layers Groups Institutes Function Staff
Department of Computer Science Homepage Perl Database ERM-Model Layers Groups Institutes Function Staff m 1 User client 4 external Courses gives 0,1 m HTML 3 The second concept used in our homepage is a small database, the queries of which are written in Perl. The data is stored in text files, every line of which contains a tuple. The records are separated by semicola. The database contains frequently used information that is needed on more than one page, where the pages are structured differently. It contains the information for the personal homepages of the staff, Ph.D. students, professors ... and the department’s structure, the industrial courses given by members of our department or people from outside, the events and dates (birthdays, symposia, holidays ...) of our department. All the Perl scripts create PreHTML files. Therefore it is guaranteed that also all the script generated pages have the same header and footer as the pages changed by hand. Not to forget that this way they can also make use of all the preprocessor commands. The picture of the layers should only show, that the Perl scripts are not intended to create (dynamic) HTML code on the fly. The data stored in the database is not so important that it has to be accessible for the whole world immediately. People are expected to wait one day until they see the new data. PreHTML 2 Agenda m 0,1 Perl 1 © 1998, Leonhard Jaschke, Institut für Wissenschaftliches Rechnen
5
Revision Control System (RCS)
Department of Computer Science Homepage Revision Control System (RCS) What is it? Unix “built in” revision control: Logging of changes Rollback to earlier revisions Locking files currently being changed Fully supported by Emacs The revision control system commonly included in every UNIX distribution is used by our administrators to coordinate each other. With this system they can easily: log the changes that they have made, which includes a message by the author, alteration date and the authors login name, make a rollback to an earlier version if a change of a file was not that good. Files that are currently changed are locked, so that no one else could use it, until the author tells the system that he has finished changing the file. The functions of RCS are included in a pull down menu in Emacs, a text editor that runs on several platforms, which is certainly the most commonly used editor in Unix. © 1998, Leonhard Jaschke, Institut für Wissenschaftliches Rechnen
6
Conclusion HTML Preprocessor Perl database
Department of Computer Science Homepage Conclusion HTML Preprocessor Perl database Cannot be edited by common HTML editors Can manage pages with different languages portable (ASCII, Perl) Minimizes inconsistent pages Easy definition of a uniform layout With cron and make: Correct timestamp for every page More programming work than with a common DBS but also more flexible Minimizes inconsistent data RCS I want to finish my talk with a conclusion of the three main concepts of our new web site: The HTML preprocessor has the disadvantage that it cannot be edited by common HTML editors, although editors that do not use WYSIWIG have the chance to support it partly. Emacs can also be configured to support the PreHTML tags as well as it does already support the HTML tags. Advantages of the HTML preprocessor are that with its help it is possible to easily handle different languages and therefore minimize inconsistency in web pages. It is portable because it is written in Perl and it uses a plain ASCII format like HTML. The preprocessor makes it easy to define a uniform layout and what is also important to me: Together with a cron job and the make command one can guarantee that all pages have a correct timestamp (which I always used to forget to change). The Perl database has indeed the disadvantage that its building and support needs more work than a common DBS. But it is also more flexible, because you can program queries in Perl that are not possible in a normal DBS (e. g. separating the TITLE tag from all HTML files within a certain subdirectory and combine this information with the name of the subdirectory, the HTML file resides in). With this database the amount of inconsistent information is further minimized. RCS has the advantages that documentation can be created on the fly and that it coordinates the work of the administrators. This finishes the talk. Thank you for listening. Logs provide automatic documentation information Coordinates the work of several administrators © 1998, Leonhard Jaschke, Institut für Wissenschaftliches Rechnen
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.