Skip to contentSkip to conversation

Ack! The Xen Interfaces web page is making me blind!

DISCUSSION Randy Thelen 1 participant 1 message Feb 28, 2006

lore
Share & tools
lore
#0 lore raw

Folks --

I've been squinting at the Developer Manual for too damn long. I built a perl script for fixing, what I believe, to be a bug in the HTML for the Xen interfaces documentation web page.

The problem, as I see it, is the abundance of <FONT SIZE="-2"> ... </FONT> tags lying around. They begin to affect text at section 4.1.3:

http://www.cl.cam.ac.uk/Research/SRG/netos/xen/readmes/interface/interface.html#SECTION00513000000000000000

The script I wrote carefully removes all the offending tags and makes, in my humble opinion, a much more readable version of the web page.

Here's the Perl script I wrote to perform the work:

$ cat stripfont-2.pl
#!/usr/bin/perl -w
use strict;

undef $/; # Enter "file slurp" mode

$_ = <>; # Read entire file

s{ <FONT\ SIZE="-2"> # Start at an opening <FONT> tag.
( # Keep track of the stuff in between.
(
[^<] | # Either the segment doesn't begin
with an angle bracket, or

           </?A[^>]*>       |  # ... it does and it's an anchor tag  
(opening or closing)
           <BR>             |  # ... it's a simple break.
           </?(TT|I|B|EM)>     # ... it's an opening or closing tag.
          )*                   # Collect them all

)
</FONT> # Up to </FONT>
}{$1}gix; # Replace with the stuff between the
opening/closing FONT tags.

print $_; # Output the results

Ideally, "the web admin" would run this script on the Xen interfaces .html for us. Else, the version of the .html with the the font tags stripped can be found here:

http://www.madscientistroom.org/xen-interface2.html

The stripfont-2.pl script can be found here:

http://www.madscientistroom.org/stripfont-2.pl

I ran the above script with the following command line:

$ cat xen-interface.html | ./stripfont-2.pl > xen-interface2.html

Incidentally, the PDF file is fine.

-- Randy