6.1 Introduction


Website META Language (WML) is a programming language created by Ralf Engelschall to build HTML code ”thus a meta language (see www.thewml.org). It provides a convenient way to create and maintain complex static web sites (as opposed to the dynamic web sites we'll create later with CGI, mod_perl, Embperl, Mason, etc.). It's especially useful for maintaining a consistent look and feel across the web site. As such, it's a step up from plain HTML for building a web site, but is easier to use and less complex than the dynamic web tools we'll study in later chapters.

If your site serves up a large number of static web pages, with WML you can change all the pages by changing one template and then executing a make -like command. Another advantage of using WML is that after compilation, there's no more server-side processing; in contrast, the dynamic languages we'll discuss later have to be executed on the server when they are called. In addition, with WML the client-side browser gains a speed advantage from being able to cache the static pages.

The distinction here is something like that of a compiled language versus an interpreted one, with WML being the former and Embperl, Mason, et al., being the latter.

As you go through this chapter, remember that in using WML, you should edit only the .wml files, not the .html files. The latter are the output of the former.

6.1.1 A Note about Apache and This Chapter

Our web site, www.opensourcewebbook.com/, serves up the WML examples in this chapter. The examples are stored in files named with the .wml extension. For you to read the WML sources properly, Apache must be configured to serve up these types of files as plain text, so, as root , we added the following line to /etc/httpd/conf/httpd.conf :

 AddType text/plain .wml 

You probably do not want to make your WML source files available for general perusal, just out of general paranoia . You can add the following Files directive to the bottom of the Apache configuration file ( /etc/httpd/conf/httpd.conf ) to deny access to these files. For all files that end in .wml , deny access from all clients .

 <Files ~ "\.wml$">      Order allow,deny      Deny from all  </Files> 

If you modified Apache's configuration file, be sure to restart httpd :

 #  /etc/init.d/httpd graceful  

6.1.2 WML Programs

WML consists of a collection of programs used to build and maintain a web site. These programs are the following:

wml: Website META Language Control The control program for WML. It passes the .wml file through the nine phases of processing (discussed later). You seldom, if ever, need to run this manually.

wmk: Website META Language Make A high-level front end for wml . This program is usually used to invoke wml with command-line options.

wmd: Website META Language Documentation Browser Use it to browse the WML documentation.

wmu: Website META Language Upgrade Utility This is a nifty tool to automatically upgrade WML, if necessary, by fetching the file via HTTP, extracting the tarball, and then building and installing the new version.

wmb: Website META Language Bug Reporting Tool Use this tool to send a bug report.



Open Source Development with Lamp
Open Source Development with LAMP: Using Linux, Apache, MySQL, Perl, and PHP
ISBN: 020177061X
EAN: 2147483647
Year: 2002
Pages: 136

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net