Webindex

Webindex is the Perl script I use to generate the contents page for my personal website. It is inherently somewhat customised to my own needs, but might prove useful to others. This web page constitutes the only available documentation.

Requirements

You will need:

Download

You can fetch it from CVS via chiark's cvsweb interface; visit this URL:

http://www.chiark.greenend.org.uk/ucgi/~richardk/cvsweb/webtools/webindex

When you have downloaded the script, put it somewhere appropriate in your path and make it executable.

Preparing To Use Webindex

HTML Files

Each HTML file that you want to appear in the contents page should have a couple of META elements inside its header: one to contain a description and one identifting the category that the file falls into. For example, this page has the following:

<meta
  name=description
  content="A Perl program for generating HTML contents pages">
<meta
  name=category
  content=software>

HTML files that lack these elements will be ignored. Note that only HTML files with names ending .html or .htm will be recognized.

Note that each category must be listed in @categories; see below.

Images

Webindex will attempt to generate thumbnails for any images it discovers. You can suppress this within a directory by creating a .nothumb file.

Currently thumbnails are not actually used by Webindex once they have been generated.

Webindex will only categorize images if there is a corresponding .var file. It looks in the comments for details of the following form:

# summary=A picture of a galaxy
# title=Galaxy

Also it looks at the URI: lines to determine which formats the image is available in.

Configuring Webindex

Create a .webindex.conf file in the root of your web document tree. This file is sourced by the script to define certain variables:

$title
This defines the title of the contents page.
$style
This defines the style sheet to link to. Optional.
$lang
This defines the value of the LANG attribute on the initial <HTML> tag. Optional.
@categories
This defines the list of categories to be included in the contents page. Documents with categories not in this list will be omitted.
$footer
This defines a string to put at the end of the contents page, just before the </BODY> tag. Optional.

By way of example, the .webindex.conf that I used contains the following:

$footer = '<p><a href="./">RJK</a> | <a href="contents.html">Contents</a>';
$title = "Contents";
$style = "rjk.css";
$lang = "en";
@categories = qw(Personal Photos Fiction Articles Postings Reference Software Pictures Unsorted);

Running Webindex

Finally run webindex. The contents file will be written to standard output. Various bits of debugging and progress information will be written to standard error.

Bugs

Please report bugs to me at rjk@greenend.org.uk. You should check that your bug is not fixed in a later version before doing so. If you send a patch, please use "diff -u" format.

Copyright

Webindex is copyright © 2000, 2001 Richard Kettlewell. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

RJK | Contents