Browse Source

decode-dimms: Generate XHTML 1.1 compliant markup

In HTML output mode, generate XHTML 1.1 compliant markup.


git-svn-id: http://lm-sensors.org/svn/i2c-tools/trunk@6183 7894878c-1315-0410-8ee3-d5d059ff63e0
tags/v4.0
Jean Delvare 12 years ago
parent
commit
8b465452b3
  1. 2
      CHANGES
  2. 24
      eeprom/decode-dimms

2
CHANGES

@ -37,7 +37,7 @@ SVN HEAD
Add support for Load Reduced DIMM (LRDIMM) DDR3 modules Add support for Load Reduced DIMM (LRDIMM) DDR3 modules
Fully decode the DDR3 SDRAM Device Type field Fully decode the DDR3 SDRAM Device Type field
Encode "degrees" to HTML degree symbol Encode "degrees" to HTML degree symbol
Generate HTML 4.01 compliant markup
Generate XHTML 1.1 compliant markup
i2cdetect: Do a best effort detection if functionality is missing i2cdetect: Do a best effort detection if functionality is missing
Clarify the SMBus commands used for probing by default Clarify the SMBus commands used for probing by default
i2c-dev.h: Minimize differences with kernel flavor i2c-dev.h: Minimize differences with kernel flavor

24
eeprom/decode-dimms

@ -413,7 +413,7 @@ sub html_encode($)
$text =~ s/</\&lt;/sg; $text =~ s/</\&lt;/sg;
$text =~ s/>/\&gt;/sg; $text =~ s/>/\&gt;/sg;
$text =~ s/ degrees C/\&deg;C/sg; $text =~ s/ degrees C/\&deg;C/sg;
$text =~ s/\n/<br>\n/sg;
$text =~ s/\n/<br\/>\n/sg;
return $text; return $text;
} }
@ -438,11 +438,11 @@ sub real_printl($$) # print a line w/ label and values
if ($opt_html) { if ($opt_html) {
$label = html_encode($label); $label = html_encode($label);
@values = map { html_encode($_) } @values; @values = map { html_encode($_) } @values;
print "<tr><td valign=top>$label</td>";
print "<tr><td style=\"vertical-align: top;\">$label</td>";
if (!$opt_merge) { if (!$opt_merge) {
print "<td>$_</td>" foreach @values; print "<td>$_</td>" foreach @values;
} elsif ($same_values) { } elsif ($same_values) {
print "<td colspan=".(scalar @values).">$values[0]</td>";
print "<td colspan=\"".(scalar @values)."\">$values[0]</td>";
} else { } else {
# For HTML output, merge adjacent cells even if # For HTML output, merge adjacent cells even if
# the whole line cannot be merged. # the whole line cannot be merged.
@ -451,7 +451,7 @@ sub real_printl($$) # print a line w/ label and values
$colcnt++; $colcnt++;
my $value = shift @values; my $value = shift @values;
next if (@values && $value eq $values[0]); next if (@values && $value eq $values[0]);
print "<td" . ($colcnt > 1 ? " colspan=$colcnt" : "") .">$value</td>";
print "<td" . ($colcnt > 1 ? " colspan=\"$colcnt\"" : "") .">$value</td>";
$colcnt = 0; $colcnt = 0;
} }
} }
@ -508,7 +508,7 @@ sub real_prints($) # print separator w/ given text
$ncol = 1 unless $ncol; $ncol = 1 unless $ncol;
if ($opt_html) { if ($opt_html) {
$label = html_encode($label); $label = html_encode($label);
print "<tr><td align=center colspan=".(1+$ncol)."><b>$label</b></td></tr>\n";
print "<tr><td style=\"font-weight: bold; text-align: center;\" colspan=\"".(1+$ncol)."\">$label</td></tr>\n";
} else { } else {
print "\n---=== $label ===---\n"; print "\n---=== $label ===---\n";
} }
@ -2167,11 +2167,13 @@ if (!$opt_igncheck) {
if ($opt_html && !$opt_bodyonly) { if ($opt_html && !$opt_bodyonly) {
print "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\">\n",
"<html><head>\n",
"\t<meta HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\">\n",
"\t<title>PC DIMM Serial Presence Detect Tester/Decoder Output</title>\n",
"</head><body>\n";
print "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n\n",
"<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\">\n",
"<head>\n",
"\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />\n",
"\t<title>PC DIMM Serial Presence Detect Tester/Decoder Output</title>\n",
"</head>\n\n",
"<body>\n";
} }
printc("decode-dimms version $revision"); printc("decode-dimms version $revision");
@ -2355,7 +2357,7 @@ for $current (0 .. $#dimm) {
printl2("\n\nDecoding EEPROM", $dimm[$current]->{file}, printl2("\n\nDecoding EEPROM", $dimm[$current]->{file},
"text-decoration: underline; font-weight: bold;"); "text-decoration: underline; font-weight: bold;");
} }
print "<table border=1>\n" if $opt_html;
print "<table border=\"1\">\n" if $opt_html;
my @output = @{$dimm[$current]->{output}}; my @output = @{$dimm[$current]->{output}};
for (my $line = 0; $line < @output; $line++) { for (my $line = 0; $line < @output; $line++) {

Loading…
Cancel
Save