Boxy but good
I finally got around to downloading
Common Lisp HyperSpec 6.0. It was slightly prettier than the previous version, but still needed some cleaning up for my tastes – I prefer a reference I'm consulting often not to have superfluous images and overlarge formatting.
Tidy, Perl (!) and CSS help a bit.
First, I run tidy:
$ tidy -q -w 10000 -asxml -c -m Body/*.htm Front/*.htm Issues/*.htm
tidy gives some errors, but now we have mostly valid XHTML files with
some CSS. Next, we use Perl to modify the documents a bit more. I call
the following reformat.pl:
#!/usr/bin/perl -wpi
s{<img.+?alt="(.+?)".*?>}{$1}mg;
s{(</title>)}
{$1\n<link rel="stylesheet"
href="../style.css"
type="text/css"
media="screen" />}g;
s{</h1>}{}g;
s{(\QSpec (TM)]</a>\E)}{$1</h1><br />\n}g;
s{\QXANALYS]</a>\E}{Xanalys]</a> }g;
$ ./reformat.pl Body/*.htm Front/*.htm Issues/*.htm
(The regexp substitution which was broken to multiple lines should be all on one line.) After this, just put a stylesheet with the name
style.css
in the HyperSpec root, something like this:
body {
color: black;
background: white;
margin-left: 3%;
margin-right: 3%;
}
a:hover { color: #aa1050; }
h1 {
border-width: 1px;
border-color: black black black black;
border-style: solid;
padding: 3px;
width: 100%;
background-color: #dddddd;
font-size: 1.3em;
}
h2 { font-size: 1.2em; }
And the CLHS experience is so much more pleasant.
(Note: The files in the CLHS tarball are mode 444 by default, so you need to change that before doing any modifications. tidy's -m flag fails silently if it's unable to overwrite the file it's working on.)