Department of Computer Science and Technology

Formatting HTML pages in Computer Laboratory house style

At the Computer Laboratory, we use the program /anfs/www/tools/bin/ucampas in order to give our main web pages a common house-style look and feel. It can equally be used to format research-group pages, personal web pages, websites of other departments, etc.

Getting started

Ucampas reads a simple, undecorated file named something-b.html and generates from that a file named something.html. The former (*-b.html) file is intended for human editing, the latter will be served to the web browser.

The input file should be a normal plain web page (HTML 4 or XHTML 1), such as

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<title>Document title</title>
<h1>Main heading</h1>
<p>Some text ...
<h2 id="section1">A section heading</h2>

Save this example file as test-b.html. Then type into the shell the command line

/anfs/www/tools/bin/ucampas test

The input file test-b.html is now read in, transformed to match the house style and written out as test.html, which you can then view with a web browser.

For convenience, you can add "/anfs/www/tools/bin" to your $PATH environment variable. Or you can place into any directory where you have web pages a Makefile of the form

%.html: %-b.html
	/anfs/www/tools/bin/ucampas $*

all: index.html

This way you only have to type "make filename.html" to call ucampas. More on make ...

Advanced functions

Ucampas can do lots more for you, including automatically generating hierarchical navigation bars, breadcrumbs, tables of contents, file listings, news bulletins from RSS feeds, etc. If you have sub pages, just list their filenames separated by commas in a uconfig.txt file in the same directory. There are also lots of configuration options. The reference manual provides all the details. Ucampas developer Markus Kuhn is also often happy to give quick personal tutorials.

Migration from previous system

Ucampas now replaces the older /anfs/www/html/UoCCL/template/ script that was used before 2007. If you have an existing something.tmpl file for that older script, there is a quick migration path. Simply call

/anfs/www/html/UoCCL/template/ -b something

This will write a something-b.html file suitable for input to ucampas. If ucampas doesn't like that as input, you probably had some HTML syntax errors on your old page. The HTML Validator or /anfs/www/tools/bin/htmlcheck can help you to fix these.