summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorot <ot@localhost>2005-03-18 06:37:30 +0000
committerot <ot@localhost>2005-03-18 06:37:30 +0000
commit3450691aaa3c2451fd8e5feff5d3cfc731615c77 (patch)
tree9ed3035fb43aafc39b8f60b06b046913418662b4
parente8ce9503dd65ef81f915e077cbd131733cf7e600 (diff)
downloadmarkup-validator-3450691aaa3c2451fd8e5feff5d3cfc731615c77.zip
markup-validator-3450691aaa3c2451fd8e5feff5d3cfc731615c77.tar.gz
markup-validator-3450691aaa3c2451fd8e5feff5d3cfc731615c77.tar.bz2
error explanations doc - separating items with an explanation from items that do not
-rwxr-xr-xmisc/docs_errors.pl51
-rw-r--r--share/templates/en_US/docs_errors.tmpl35
2 files changed, 70 insertions, 16 deletions
diff --git a/misc/docs_errors.pl b/misc/docs_errors.pl
index 1e98a8a..ae6c5d4 100755
--- a/misc/docs_errors.pl
+++ b/misc/docs_errors.pl
@@ -2,7 +2,7 @@
##
## Generates HTML documentation of error messages and explanations
## for W3C Markup Validation Service
-## $Id: docs_errors.pl,v 1.1 2005-03-17 06:30:13 ot Exp $
+## $Id: docs_errors.pl,v 1.2 2005-03-18 06:37:30 ot Exp $
## Pragmas.
use strict;
@@ -77,10 +77,11 @@ our $T = HTML::Template->new(
die_on_bad_params => FALSE,
);
-$T->param(list_errors => &list_errors($RSRC));
+$T->param(list_errors => &list_errors_hasverbose($RSRC));
+$T->param(list_errors => &list_errors_noverbose($RSRC));
print $T->output;
-sub list_errors{
+sub list_errors_hasverbose{
my $RSRC = shift;
my $errors = [];
my $error_id;
@@ -90,12 +91,44 @@ sub list_errors{
my %single_error;
if ($RSRC->{msg}->{$error_id})
{
- my $original = $RSRC->{msg}->{$error_id}->{original};
- $original = &de_template_explanation($original);
- $single_error{original} = $original;
- $single_error{verbose} = $RSRC->{msg}->{$error_id}->{verbose};
- $single_error{id} = $error_id;
- push @{$errors}, \%single_error;
+ my $verbose = $RSRC->{msg}->{$error_id}->{verbose};
+ if ($verbose)
+ {
+ my $original = $RSRC->{msg}->{$error_id}->{original};
+ $original = &de_template_explanation($original);
+ $single_error{original} = $original;
+ $single_error{id} = $error_id;
+ $single_error{verbose} = $RSRC->{msg}->{$error_id}->{verbose};
+ push @{$errors}, \%single_error;
+ }
+
+ }
+ }
+ print $errors;
+ return $errors;
+}
+
+sub list_errors_noverbose{
+ my $RSRC = shift;
+ my $errors = [];
+ my $error_id;
+ my $max_error_id=500; # where to stop
+ for ($error_id=0;$error_id<$max_error_id;$error_id++)
+ {
+ my %single_error;
+ if ($RSRC->{msg}->{$error_id})
+ {
+ my $verbose = $RSRC->{msg}->{$error_id}->{verbose};
+ if (! $verbose)
+ {
+ my $original = $RSRC->{msg}->{$error_id}->{original};
+ $original = &de_template_explanation($original);
+ $single_error{original} = $original;
+ $single_error{id} = $error_id;
+ $single_error{verbose} = $RSRC->{msg}->{$error_id}->{verbose};
+ push @{$errors}, \%single_error;
+ }
+
}
}
print $errors;
diff --git a/share/templates/en_US/docs_errors.tmpl b/share/templates/en_US/docs_errors.tmpl
index f094b31..40d7913 100644
--- a/share/templates/en_US/docs_errors.tmpl
+++ b/share/templates/en_US/docs_errors.tmpl
@@ -1,5 +1,5 @@
-<!--#set var="revision" value="\$Id: docs_errors.tmpl,v 1.1 2005-03-17 06:30:13 ot Exp $"
---><!--#set var="date" value="\$Date: 2005-03-17 06:30:13 $"
+<!--#set var="revision" value="\$Id: docs_errors.tmpl,v 1.2 2005-03-18 06:37:30 ot Exp $"
+--><!--#set var="date" value="\$Date: 2005-03-18 06:37:30 $"
--><!--#set var="title" value="Error Explanations for The W3C Markup Validation Service"
--><!--#set var="relroot" value="../"
--><!--#include virtual="../header.html" -->
@@ -18,14 +18,35 @@
</div>
<div>
- <h3>Listing of errors and their explanation</h3>
+ <h3 id="hasverbose">List of Validator errors and their explanation</h3>
+ <p>Below are all the validator's error messages for which we have an "explanation".</p>
+
<dl>
- <TMPL_LOOP NAME="list_errors">
- <dt><TMPL_VAR NAME="id"> <TMPL_VAR NAME="original"></dt>
- <dd><TMPL_VAR NAME="verbose"></dd>
+ <TMPL_LOOP NAME="list_errors_hasverbose">
+ <dt><TMPL_VAR NAME="id">: <TMPL_VAR NAME="original"></dt>
+ <dd><TMPL_VAR NAME="verbose">
+ <p>
+ <a href="feedback.html?errmsg_id=<TMPL_VAR NAME="id">#errormsg"
+ title="Suggest improvements on this error message through our feedback channels">&#x2709;</a>
+ </p>
+ </dd>
</TMPL_LOOP>
</dl>
- </div>
+
+ <h3 id="noverbose">Errors without explanation</h3>
+ <p>The following validation errors do not have an explanation yet. We invite you to use the
+ <a href="../feedback.html#errormsg">feedback channels</a> to send your suggestions.</p>
+ <ul>
+ <TMPL_LOOP NAME="list_errors_noverbose">
+ <li><p><TMPL_VAR NAME="id">: <TMPL_VAR NAME="original"></p>
+ <p class="helpwanted">
+ <a href="feedback.html?errmsg_id=<TMPL_VAR NAME="id">#errormsg"
+ title="Suggest improvements on this error message through our feedback channels">&#x2709;</a>
+ </p>
+ </li>
+ </TMPL_LOOP>
+ </ul>
+ </div>
<!--#include virtual="../footer.html" -->
</body>
</html> \ No newline at end of file