Greg's photos
Greg's diary
Greg's home page
HOWTO index
Google

I've had a couple of enquiries on how I create my web pages. People who look at the source code note that it's structured in a uniform, legible way. It's obviously not created by any Microsoft tool.

In fact, until mid-2002 my web pages were a real mess. People kept telling me that they wouldn't display on their browsers (usually Microsoft, but lynx was also a common one). After some investigation I discovered the W3C HTML validator, which among other things showed me that I had misunderstood the HTML comment syntax, and a lot of browsers interpreted my pages as one big comment.

Using a web-based validator is slow and cumbersome. The same page pointed me to HTML tidy, a program which performs local validation, conversion and formatting. This allows me to write code (with Emacs) which looks quite untidy, and then format it in a manner which I like. Well, almost.

tidy has a number of options for formatting. It reads a file from one of a number of possible places; I call mine .tidyconfig and set the environment variable HTML_TIDY to point to it:

HTML_TIDY=/home/grog/public_html/.tidyconfig
My .tidyconfig file contains (at the moment):
hide-endtags: yes
char-encoding: latin1
fix-backslash: no
break-before-br: yes
wrap: 100
indent: auto
gnu-emacs: yes
Follow the link above to get it in an up-to-date and usable form use.

Unfortunately, tidy leaves some text formatted in a way which is either to dense or too sparse for my liking. I fix this with an Emacs macro retidy-html.

I keep the pages under RCS, the Revision Control System. That's the reason for keywords like $Id: webcreate.php,v 1.4 2017/12/08 22:33:09 grog Exp $, which automatically gets changed each time I check in the file. The time is in UTC.

I use a separate method for creating web pages from digital photos. There are a number of scripts, mainly encased in a Makefile. Here's an overview. The sizes and dates are correct at the time of writing this page, but may have changed since.

-r--r--r--   1 grog  lemis  111808 Jul 21 13:33 .emacs
-r--r--r--   1 grog  lemis     117 Nov 16  2004 .tidyconfig
-r--r--r--   1 grog  home     9224 Sep 21 14:19 Makefile
-r-xr-xr-x   1 grog  home      369 Sep 21 14:20 basefilename
-rw-r--r--   1 grog  home     1621 Nov  8  2005 dateconv.c
-r--r--r--   1 grog  lemis  111808 Jul 21 13:33 dot.emacs
-r-xr-xr-x   1 grog  home      535 Sep 21 10:32 extend
-r-xr-xr-x   1 grog  home      334 Sep 21 14:17 findexif
-r-xr-xr-x   1 grog  home      636 Sep 21 14:23 getnames
-r--r--r--   1 grog  home      604 Sep 21 14:20 imgtemplate
-r--r--r--   1 grog  lemis     781 Sep 11  2003 index-0.html
-r--r--r--   1 grog  lemis      75 Sep 11  2003 index-1.html
-r--r--r--   1 grog  lemis     317 Sep 11  2003 index-n.html
-r--r--r--   1 grog  home     4373 Sep 21 14:22 makelinkedimages
-r--r--r--   1 grog  home     2192 Oct 24  2004 makelinkedpages
-r--r--r--   1 grog  lemis    1205 Apr 17  2006 thumbnail-0.html
-rw-r--r--   1 grog  lemis      75 Aug 30  2004 thumbnail-1.html
-rw-r--r--   1 grog  lemis     325 Jun 24  2006 thumbnail-n.html
-r--r--r--   1 grog  lemis     683 Oct 22  2006 thumbtemplate
-r--r--r--   1 grog  lemis     853 Aug 30  2004 thumbtemplate-tabular
The first three files are:

Note also dateconv.c, a small C program to convert the directory name into a date. There's a target to build it in the Makefile. The remainder of the files are template files used by the scripts to create web pages. At some point I may add more instructions; for the time being, you'll have to read the Makefile for anything not described here or in the how to page.


Greg's home page Greg's diary Greg's photos Greg's links Copyright information

Valid XHTML 1.0! $Id: webcreate.php,v 1.4 2017/12/08 22:33:09 grog Exp $