XEmacs is my editor of choice, for
pretty much everything. For those of you who may
not be familiar with it, it is a giant
monstrosity which has been extended to be able to
process Usenet news, email, the WWW, and a raft
of other things no sane programmer would
concieve.
Actually, XEmacs (and it's progenitor, FSF
Emacs) are very nice programs for editing
whatever you want. The program is founded on a
Lisp interpreter, and nearly all of the
functionality is implemented in that language.
Since it is interpreted, it makes it very easy to
modify things and see the effect immediately; no
edit-compile-run cycle.
Anyway, XEmacs has a very nice "mode" which
allows for the validated editing of web pages -
PSGML. It will parse the DTD and allow you to
things like auto-completion of tags, and to look
up and edit the valid attributes of a given tag,
without having to know what those attributes
are.
For those who code their web pages by hand, I
can't imagine doing it with any other tool; save,
perhaps, Amaya.
What I wanted to do was to have a consistent
header and footer over all the pages which make
up my web site. No problem, put it all together
and cut-and-paste...until I wanted to make a
change. That change, however small, would have to
be done for each web page on my site. Yuk.
I started out with HTML and frames, but I
dislike frames, because either you get stuck
inside a frame, or you have to munge every link
to make the browser fill the window with the page
displayed. So I started to investigate other
technologies.
First up was SSI, or Server-Side Includes.
This allows one to have the www server perform
some processing of the web page before it sends
it off to the client (your web browser). In my
case, having it automatically include the header
and footer allows me to write that HTML just
once, and have every other page use it.
However, not all sites are set up to allow
SSI; and it's no wonder, since having the server
perform this function sucks up CPU cycles,
thereby either decreasing the performance of that
server box, or necessitating an upgrade to the
hardware.
So, along came SGML, XML and, particularly, docbook. Docbook is a DTD - a Document
Type Definition. A DTD is something which the
SGML (Simple
Generalized Markup Language) crowd
came up with - it is a set of rules which
describes the structure of a document, including
which tags are valid, and in what contexts.
Docbook was created, and is maintained by, the Oasis Consortium. From their web
page:
OASIS is an international, not-for-profit
consortium that designs and develops industry
standard specifications for interoperability
based on XML.
Since docbook is simply text, it is easy to
store, maintain, edit, enhance, etc. And since it
is either SGML or XML, it can be processed into
many different things from a single source. For
instance, a docbook document can be rendered into
a high-quality print format, such as Adobe
Acrobat, and also into HTML, for display on the
web. This can be a huge boon for companies
looking to be able to put their catalog on the
web.
So, I coded my web site in both the SGML and
XML instances of docbook, and ran them each
through a formatting processor; jade for the SGML
instance and xalan for the XML instance.
Now, while docbook can produce a rather nice
web site (see The FreeBSD Handbook for a look at
what it can produce), it really was
meant for technical documentation, and it just
didn't do what I wanted to do with this web site.
I probably could have used the XML version and
derived my own XSL transform to handle the
sniggling things, but I just didn't want to delve
into it at that time.
So, I settled on using XHTML, which is HTML
recoded as an XML Schema. I use it as a
"compiled" HTML; I take the XHTML, and run it
through a trivial XSL stylesheet (in XML-land,
it's really a transform) which
produces still more XHTML. In point of fact, it
produces exactly the same XHTML, with one
notable exception: I can set up "ENTITIES", which
allow me to simply include another file at the
spot of the directive, as if I had typed in the
contents of said file myself. Voila! A "compiled"
web site, allowing me to have the header and
footer reside in separate physical files, where I
can change them at my leisure, and then simply
regenerate my entire web site.
However, not too long after I undertook this
effort, I came across the docbook web site, the pages
maintained by Norm Walsh, author of the O'Reilly
book, Docbook, The Definitive Guide. I was
interested in the XSL transforms he has there,
since I was working on some technical docs. Well,
when I went to the sourceforge page, I noticed the
Website DTD up there. I downloaded it, and looked
at the example that he has in there, and I was
hooked.
The biggest advantage that the website DTD has
over plain ole Xhtml is the concept of a table of
contents, as you can see on the left. What is
nice about this is that I only have to specify
the hierarchy of my web site in a single place,
and each page gets the TOC compiled into it.
Sweet!
The Website DTD is a customization of the
Docbook DTD, allowing for a few more elements. It
specifies its own XSL transforms on top of
docbook.
CSS stands for Cascading Style Sheets; it is a
specification governing how web content is
displayed. By using stylesheets properly, one can
produce a web site where the content is separate
from the display. Moreover, it is relatively easy
to make certain that one's web pages are viewable
according to the user's choice of font size,
colors, etc.
For instance, take a look at the Micro Xpress home page; from there,
click on "hardware".
If you did that from within Internet Explorer,
then you're fine; if you are reading those
stories from within Mozilla, especially under Linux or
FreeBSD, then you ought to see a font that's
pretty small. Despite the fact that I set my font
size within my browser, their web page remains
the same.
Had they used CSS stylesheets to specify their
font and other properties, they would be able to
respect the users' choices. Too many web page
authors want to dictate the viewing experience to
the user -- in that case, they should just use
PDF and be done with it.
ALL my CSS
properties are specified as relative properties
-- using EMs, generally. All indentations, margin
specifications, and font sizes are either EM-type
units or specified as a percentage.