Skip to content

Commit e61105f

Browse files
committed
Add script for regenerating DoC, curl command for regenerating Overview.html.
1 parent c68aeb3 commit e61105f

2 files changed

Lines changed: 135 additions & 0 deletions

File tree

bin/issuegen.pl

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
#!/usr/bin/perl
2+
3+
# Color coding
4+
# Note statuses will get lowercased before lookup
5+
%statusStyle = (
6+
'accepted' => 'a',
7+
'retracted' => 'a',
8+
'rejected' => 'r',
9+
'objection' => 'fo',
10+
'deferred' => 'd',
11+
'invalid' => 'oi',
12+
'outofscope' => 'oi',
13+
);
14+
# Header template is at the end of the file
15+
16+
################################################################################
17+
18+
my $inFile = $ARGV[0];
19+
if (!$inFile) {
20+
print "Pass in issues list filename for processing!\n";
21+
print "Template for issues-list.txt follows...\n";
22+
print <<XXX;
23+
Draft: http://www.w3.org/TR/2013/WD-css-text-decor-3-20130103/
24+
Title: CSS Text Decoration Level 3
25+
... anything else you want here, except 4 dashes ...
26+
----
27+
Issue 1.
28+
Summary: [summary]
29+
From: [name]
30+
Comment: [url]
31+
Response: [url]
32+
Closed: [status ... or replace this "Closed" line with "Open"]
33+
Verified: [url]
34+
----
35+
XXX
36+
exit;
37+
}
38+
39+
# Input/Output setup
40+
my $outFile = $inFile;
41+
$outFile =~ s/\.txt/\.html/;
42+
open IN, "<", $inFile || die "Cannot open $inFile: $!";
43+
open OUT, ">", $outFile || die "Cannot open $outFile: $!";
44+
$/ = "----\n";
45+
46+
# Header
47+
&header;
48+
49+
# Issues
50+
while (<IN>) {
51+
chomp;
52+
53+
# Issue number
54+
s/Issue (\d+)\./Issue \1. <a href="#issue-\1">#<\/a>/;
55+
$index = $1;
56+
57+
# Color coding
58+
$code = '';
59+
if (/\nVerified:\s+http/) {
60+
$code = 'a';
61+
print "Verified!";
62+
}
63+
elsif (/\n(?:Closed|Open):\s+(\S+)/) {
64+
$code = $statusStyle{lc $1};
65+
}
66+
if (/\nOpen/) {
67+
$code .= ' ' if $code;
68+
$code .= 'open';
69+
}
70+
71+
# And print it
72+
print OUT "<pre class='$code' id='issue-$index'>\n";
73+
s/(http\S+)/<a href="\1">\1<\/a>/g;
74+
print OUT;
75+
print OUT "</pre>\n";
76+
}
77+
78+
sub header {
79+
# Read header
80+
local $_ = <IN>;
81+
chomp;
82+
83+
# Extract title and URL
84+
my $title, $url;
85+
for (split /\n+/) {
86+
$title = $1 if (/^Title:\s+(.+)$/);
87+
$url = $1 if (/^Draft:\s+(\S+)/);
88+
}
89+
die "Error: missing document URL or title.\n" unless ($url && $title);
90+
91+
# Process URL to get status, date, shorname
92+
die "Error: Draft URL wrong format.\n" unless
93+
($url =~ /([A-Z]{2})-([a-z0-9-]+)-(\d{8})/);
94+
($status, $shortname, $date) = ($1, $2, $3);
95+
$status = 'LCWD' if ('WD' eq $status && $inFile =~ /[lL][cC]/);
96+
$date = "$1-$2-$3" if ($date =~ /(\d{4})(\d{2})(\d{2})/);
97+
98+
# Print it all out
99+
print OUT <<XXX;
100+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
101+
<title>$title Disposition of Comments for $date $status</title>
102+
<style type="text/css">
103+
.a { background: lightgreen }
104+
.d { background: lightblue }
105+
.r { background: orange }
106+
.fo { background: red }
107+
.open { border: solid red; padding: 0.2em; }
108+
:target { box-shadow: 0.25em 0.25em 0.25em; }
109+
</style>
110+
111+
<h1>$title Disposition of Comments for $date $status</h1>
112+
113+
<p>Last call document: <a href="$url">$url</a>
114+
115+
<p>Editor's draft: <a href="http://dev.w3.org/csswg/$shortname/">http://dev.w3.org/csswg/$shortname/</a>
116+
117+
<p>The following color coding convention is used for comments:</p>
118+
119+
<ul>
120+
<li class="a">Accepted or Rejected and positive response
121+
<li class="r">Rejected and no response
122+
<li class="fo">Rejected and negative response
123+
<li class="d">Deferred
124+
<li class="oi">Out-of-Scope or Invalid and not verified
125+
</ul>
126+
127+
<p class=open>Open issues are marked like this</p>
128+
129+
<p>An issue can be closed as <code>Accepted</code>, <code>OutOfScope</code>,
130+
<code>Invalid</code>, <code>Rejected</code>, or <code>Retracted</code>.
131+
<code>Verified</code> indicates commentor's acceptance of the response.</p>
132+
XXX
133+
}

bin/regenerate

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
curl -u user:pass $1 -F file=@Overview.src.html -F group=CSS -F output=html -F method=file https://www.w3.org/Style/Group/process.cgi -o Overview.html
2+

0 commit comments

Comments
 (0)