Skip to content

Commit ccf8a83

Browse files
committed
[css2] Made dextr produce the same structure as pextr.
--HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%401421
1 parent 1cf4ef2 commit ccf8a83

4 files changed

Lines changed: 78 additions & 36 deletions

File tree

css2/bin/Attic/dextr

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# <span class="propinst-name">&lt;'name'&gt;</span>
1313
#
1414
# Ian Jacobs - ij@w3.org (Based on work by Arnaud Le Hors)
15-
# $Id: dextr,v 1.15 1998-03-21 21:18:13 ijacobs Exp $
15+
# $Id: dextr,v 1.16 1998-03-24 16:06:44 bbos Exp $
1616

1717
$PROGNAME = substr($0, rindex($0, "/") + 1);
1818

@@ -51,37 +51,53 @@ $blockst = "[/][*]";
5151
$blocket = "[*][/]";
5252

5353
sub format_descriptor {
54-
$name = $_[0];
55-
$values = $_[1];
56-
$init = $_[2];
57-
$media = $_[3];
58-
print output "<DIV class=\"descdef\">\n";
54+
my $name = $_[0];
55+
my $values = $_[1];
56+
my $init = $_[2];
57+
my $media = $_[3];
58+
#Do next three lines in src files to get headings right.
59+
print output "<div class=\"descdef\">\n";
60+
print output "<dl><dt>\n";
61+
@names = split(/[, \t\n]+/, $name);
62+
$comma = "";
63+
foreach $n (@names) {
5964
if ($noindex) {
60-
print output "<P><a name=\"descdef-$name\" class=\"descdef-title\"><strong>'$name'</strong> (Descriptor)</a></P>\n";
65+
print output "$comma<a name=\"descdef-$n\" class=\"descdef-title\"><strong>'$n'</strong> (Descriptor)</a>";
6166
} else {
62-
print output "<P><span class=\"index-def\" title=\"'$_[0]' (descriptor)\"><a name=\"descdef-$name\" class=\"descdef-title\"><strong>'$name'</strong> (Descriptor)</a></span></P>\n";
67+
print output "$comma<span class=\"index-def\" title=\"'$n' (descriptor)\"><a name=\"descdef-$n\" class=\"descdef-title\"><strong>'$n'</strong> (Descriptor)</a></span>";
6368
}
69+
$comma = ", ";
70+
}
71+
print output "\n<dd>\n";
72+
print output "<table class=\"descinfo\" cellspacing=0 cellpadding=0>\n";
73+
6474
# We use cellspacing/cellpadding until more browsers
6575
# handle tables correctly.
66-
print output "<TABLE class=\"descinfo\" cellpadding=0 cellspacing=0>\n";
6776
&format_values($values);
6877
&format_init($init);
6978
&format_media($media);
70-
print output "</TABLE>\n";
71-
print output "</DIV>\n\n";
79+
print output "</table>\n";
80+
print output "</dl>\n";
81+
print output "</div>\n\n";
7282
}
7383

84+
# Include an nbsp before TD since CSS not used to
85+
# align tables yet.
7486
sub format_values {
7587
$values = $_[0];
7688
$values =~ s/<([^>']*)>/<span class=\"value-inst-$1\">&lt;$1&gt;<\/span>/g;
77-
print output "<TR valign=\"top\"><TH align=\"right\">Specified value:&nbsp;&nbsp;<TD>$values</TR>\n";
89+
print output "<tr valign=baseline>";
90+
print output "<td><em>Value:</em>&nbsp;&nbsp;";
91+
print output "<td>$values\n";
7892
}
7993

8094
sub format_init {
8195
$init = $_[0];
8296
$init =~ s/XX/not defined for shorthand properties/g;
8397
$init =~ s/<([^>']*)>/<span class=\"value-inst-$1\">&lt;$1&gt;<\/span>/g;
84-
print output "<TR valign=\"top\"><TH align=\"right\">Initial value:&nbsp;&nbsp;<TD>$init</TR>\n";
98+
print output "<tr valign=baseline>";
99+
print output "<td><em>Initial:</em>&nbsp;&nbsp;";
100+
print output "<td>$init\n";
85101
}
86102

87103
sub format_media {
@@ -95,15 +111,20 @@ sub format_media {
95111
$fmedia =~ s/all/<a href=\"media.html#all-media-group\" class=\"noxref\">all<\/a>/;
96112
$fmedia =~ s/interactive/<a href=\"media.html#interactive-media-group\" class=\"noxref\">interactive<\/a>/;
97113
$fmedia =~ s/static/<a href=\"media.html#static-media-group\" class=\"noxref\">static<\/a>/;
98-
print output "<TR valign=\"top\"><TH align=\"right\">Media&nbsp;groups:&nbsp;&nbsp;<TD>$fmedia</TR>\n";
114+
print output "<tr valign=baseline>";
115+
print output "<td><em>Media:</em>&nbsp;&nbsp;";
116+
print output "<td>$fmedia\n";
99117
}
100118

119+
101120
# extract every possible block
102121
$_ = $buf;
103122
while (/$blockst$patt;;$patt;;$patt;;$patt$blocket/s) {
104123
# Set parameters first (before any modifications)
105124
$placeholder = $';
106-
$output = "$path$1.srb";
125+
my @names = split(/[, \t\n]+/, $1);
126+
my $name = $names[0];
127+
$output = "$path$name.srb";
107128
print "\textracting $output\n";
108129
open(output, "> $output");
109130
&format_descriptor($1, $2, $3, $4);

css2/bin/Attic/pextr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# <span class="propinst-name">&lt;'name'&gt;</span>
1414
#
1515
# Ian Jacobs - ij@w3.org (Based on work by Arnaud Le Hors)
16-
# $Id: pextr,v 1.17 1998-03-23 05:04:53 ijacobs Exp $
16+
# $Id: pextr,v 1.18 1998-03-24 16:07:05 bbos Exp $
1717

1818
$PROGNAME = substr($0, rindex($0, "/") + 1);
1919

@@ -75,8 +75,8 @@ $comma = ", ";
7575
print output "\n<dd>\n";
7676
print output "<table class=\"propinfo\" cellspacing=0 cellpadding=0>\n";
7777

78-
# Sorry, we use cellspacing/cellpadding until tables
79-
# handled better in user agents.
78+
# We use cellspacing/cellpadding until more browsers
79+
# handle tables correctly.
8080
&format_values($values);
8181
&format_init($init);
8282
&format_applies($applies);

css2/bin/dextr

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# <span class="propinst-name">&lt;'name'&gt;</span>
1313
#
1414
# Ian Jacobs - ij@w3.org (Based on work by Arnaud Le Hors)
15-
# $Id: dextr,v 1.15 1998-03-21 21:18:13 ijacobs Exp $
15+
# $Id: dextr,v 1.16 1998-03-24 16:06:44 bbos Exp $
1616

1717
$PROGNAME = substr($0, rindex($0, "/") + 1);
1818

@@ -51,37 +51,53 @@ $blockst = "[/][*]";
5151
$blocket = "[*][/]";
5252

5353
sub format_descriptor {
54-
$name = $_[0];
55-
$values = $_[1];
56-
$init = $_[2];
57-
$media = $_[3];
58-
print output "<DIV class=\"descdef\">\n";
54+
my $name = $_[0];
55+
my $values = $_[1];
56+
my $init = $_[2];
57+
my $media = $_[3];
58+
#Do next three lines in src files to get headings right.
59+
print output "<div class=\"descdef\">\n";
60+
print output "<dl><dt>\n";
61+
@names = split(/[, \t\n]+/, $name);
62+
$comma = "";
63+
foreach $n (@names) {
5964
if ($noindex) {
60-
print output "<P><a name=\"descdef-$name\" class=\"descdef-title\"><strong>'$name'</strong> (Descriptor)</a></P>\n";
65+
print output "$comma<a name=\"descdef-$n\" class=\"descdef-title\"><strong>'$n'</strong> (Descriptor)</a>";
6166
} else {
62-
print output "<P><span class=\"index-def\" title=\"'$_[0]' (descriptor)\"><a name=\"descdef-$name\" class=\"descdef-title\"><strong>'$name'</strong> (Descriptor)</a></span></P>\n";
67+
print output "$comma<span class=\"index-def\" title=\"'$n' (descriptor)\"><a name=\"descdef-$n\" class=\"descdef-title\"><strong>'$n'</strong> (Descriptor)</a></span>";
6368
}
69+
$comma = ", ";
70+
}
71+
print output "\n<dd>\n";
72+
print output "<table class=\"descinfo\" cellspacing=0 cellpadding=0>\n";
73+
6474
# We use cellspacing/cellpadding until more browsers
6575
# handle tables correctly.
66-
print output "<TABLE class=\"descinfo\" cellpadding=0 cellspacing=0>\n";
6776
&format_values($values);
6877
&format_init($init);
6978
&format_media($media);
70-
print output "</TABLE>\n";
71-
print output "</DIV>\n\n";
79+
print output "</table>\n";
80+
print output "</dl>\n";
81+
print output "</div>\n\n";
7282
}
7383

84+
# Include an nbsp before TD since CSS not used to
85+
# align tables yet.
7486
sub format_values {
7587
$values = $_[0];
7688
$values =~ s/<([^>']*)>/<span class=\"value-inst-$1\">&lt;$1&gt;<\/span>/g;
77-
print output "<TR valign=\"top\"><TH align=\"right\">Specified value:&nbsp;&nbsp;<TD>$values</TR>\n";
89+
print output "<tr valign=baseline>";
90+
print output "<td><em>Value:</em>&nbsp;&nbsp;";
91+
print output "<td>$values\n";
7892
}
7993

8094
sub format_init {
8195
$init = $_[0];
8296
$init =~ s/XX/not defined for shorthand properties/g;
8397
$init =~ s/<([^>']*)>/<span class=\"value-inst-$1\">&lt;$1&gt;<\/span>/g;
84-
print output "<TR valign=\"top\"><TH align=\"right\">Initial value:&nbsp;&nbsp;<TD>$init</TR>\n";
98+
print output "<tr valign=baseline>";
99+
print output "<td><em>Initial:</em>&nbsp;&nbsp;";
100+
print output "<td>$init\n";
85101
}
86102

87103
sub format_media {
@@ -95,15 +111,20 @@ sub format_media {
95111
$fmedia =~ s/all/<a href=\"media.html#all-media-group\" class=\"noxref\">all<\/a>/;
96112
$fmedia =~ s/interactive/<a href=\"media.html#interactive-media-group\" class=\"noxref\">interactive<\/a>/;
97113
$fmedia =~ s/static/<a href=\"media.html#static-media-group\" class=\"noxref\">static<\/a>/;
98-
print output "<TR valign=\"top\"><TH align=\"right\">Media&nbsp;groups:&nbsp;&nbsp;<TD>$fmedia</TR>\n";
114+
print output "<tr valign=baseline>";
115+
print output "<td><em>Media:</em>&nbsp;&nbsp;";
116+
print output "<td>$fmedia\n";
99117
}
100118

119+
101120
# extract every possible block
102121
$_ = $buf;
103122
while (/$blockst$patt;;$patt;;$patt;;$patt$blocket/s) {
104123
# Set parameters first (before any modifications)
105124
$placeholder = $';
106-
$output = "$path$1.srb";
125+
my @names = split(/[, \t\n]+/, $1);
126+
my $name = $names[0];
127+
$output = "$path$name.srb";
107128
print "\textracting $output\n";
108129
open(output, "> $output");
109130
&format_descriptor($1, $2, $3, $4);

css2/bin/pextr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# <span class="propinst-name">&lt;'name'&gt;</span>
1414
#
1515
# Ian Jacobs - ij@w3.org (Based on work by Arnaud Le Hors)
16-
# $Id: pextr,v 1.17 1998-03-23 05:04:53 ijacobs Exp $
16+
# $Id: pextr,v 1.18 1998-03-24 16:07:05 bbos Exp $
1717

1818
$PROGNAME = substr($0, rindex($0, "/") + 1);
1919

@@ -75,8 +75,8 @@ $comma = ", ";
7575
print output "\n<dd>\n";
7676
print output "<table class=\"propinfo\" cellspacing=0 cellpadding=0>\n";
7777

78-
# Sorry, we use cellspacing/cellpadding until tables
79-
# handled better in user agents.
78+
# We use cellspacing/cellpadding until more browsers
79+
# handle tables correctly.
8080
&format_values($values);
8181
&format_init($init);
8282
&format_applies($applies);

0 commit comments

Comments
 (0)