X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=results2html;fp=results2html;h=1b4622137f65ceb6a2b660000700a6fee5b1ef46;hb=9dcb38e8079aa5258fb9abeccd8d1d23cf94376c;hp=0000000000000000000000000000000000000000;hpb=a861f41d5f49d7e57400b2d572fbdb83a62b7d28;p=pspp diff --git a/results2html b/results2html new file mode 100755 index 0000000000..1b4622137f --- /dev/null +++ b/results2html @@ -0,0 +1,163 @@ +#! /usr/bin/env perl + +use strict; +use warnings; + +use HTML::Entities; + +open (LOG, '<', "LOG"); +open (INDEX, '>','index.html'); +open (LOG_HTML, '>', "log.html"); + +print INDEX < + + + + +
    +EOF + +print LOG_HTML < + + + + +EOF +print LOG_HTML "
    ";
    +
    +my ($n_products) = 0;
    +my ($n_steps) = 0;
    +my ($new_page) = 0;
    +while () {
    +    my $ln = $.;
    +    chomp;
    +
    +    if (/^$/) {
    +	$new_page = 1;
    +	print LOG_HTML "

    \n";
    +	next;
    +    }
    +
    +    my $log_class;
    +    if ($new_page) {
    +	$new_page = 0;
    +	$log_class = "step";
    +	if (my ($product) = /^Saving (.*)$/) {
    +	    print INDEX "\n  " if !$n_steps;
    +	    print INDEX "
  1. ", encode_entities ($_); + print INDEX " (log)"; + $n_products = 0; + } + } else { + if (my ($diagnostic) = /(error|warning):/) { + if ($n_products) { + print INDEX " \n"; + $n_products = 0; + } + print INDEX "

    "; + print INDEX ""; + print INDEX encode_entities ($_); + print INDEX "

    \n"; + $log_class = "$diagnostic"; + } + } + printf LOG_HTML "%4d ", $ln, $ln; + if (defined ($log_class)) { + print LOG_HTML "", encode_entities ($_), "\n"; + } else { + print LOG_HTML encode_entities ($_), "\n"; + } +} +print INDEX " \n" if $n_products; +print INDEX "
  2. \n" if $n_steps; +print INDEX < + + +EOF + +print LOG_HTML < + + +EOF + +open (CSS, '>', "build.css"); +print CSS <p { + margin: 0pt 0pt 0pt 0em +} +body>p + p { + text-indent: 1.5em; +} +H1 { + font-size: 150%; + margin-left: -1.33em +} +H2 { + font-size: 125%; + font-weight: bold; + margin-left: -.8em +} +H3 { + font-size: 100%; + font-weight: bold; + margin-left: -.5em } +H4 { + font-size: 100%; + margin-left: 0em +} +H1, H2, H3, H4, H5, H6 { + font-family: sans-serif; + color: blue +} +html { + margin: 0 +} + +a:link { + color: blue; + text-decoration: none; +} +a:visited { + color: gray; + text-decoration: none; +} +a:active { + color: black; + text-decoration: none; +} +a:hover { + text-decoration: underline +} + +.step { + font-weight: bold +} +.warning { + background: yellow; + margin-top: 0; + margin-bottom: 0 +} +.error { + background: orange; + margin-top: 0; + margin-bottom: 0 +} +EOF