Skip to content

Commit dfee0d6

Browse files
committed
[css2] Layout with a TABLE inside DL.
Shorthened header texts. Allowed multiple properties in one table. --HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%401350
1 parent aceaafe commit dfee0d6

2 files changed

Lines changed: 90 additions & 42 deletions

File tree

css2/bin/Attic/pextr

Lines changed: 45 additions & 21 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.15 1998-03-21 21:18:11 ijacobs Exp $
16+
# $Id: pextr,v 1.16 1998-03-23 02:53:20 bbos Exp $
1717

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

@@ -52,31 +52,41 @@ $blockst = "[/][*]";
5252
$blocket = "[*][/]";
5353

5454
sub format_property {
55-
$name = $_[0];
56-
$values = $_[1];
57-
$init = $_[2];
58-
$applies = $_[3];
59-
$inherited = $_[4];
60-
$percentages = $_[5];
61-
$media = $_[6];
55+
my $name = $_[0];
56+
my $values = $_[1];
57+
my $init = $_[2];
58+
my $applies = $_[3];
59+
my $inherited = $_[4];
60+
my $percentages = $_[5];
61+
my $media = $_[6];
6262
#Do next three lines in src files to get headings right.
63-
print output "<DIV class=\"propdef\">\n";
63+
print output "<div class=\"propdef\">\n";
64+
print output "<dl><dt>\n";
65+
@names = split(/[, \t\n]+/, $name);
66+
$comma = "";
67+
foreach $n (@names) {
6468
if ($noindex) {
65-
print output "<P><a name=\"propdef-$name\" class=\"propdef-title\"><strong>'$name'</strong></a></P>\n";
69+
print output "$comma<a name=\"propdef-$n\" class=\"propdef-title\"><strong>'$n'</strong></a>";
6670
} else {
67-
print output "<P><span class=\"index-def\" title=\"'$_[0]'\"><a name=\"propdef-$name\" class=\"propdef-title\"><strong>'$name'</strong></a></span></P>\n";
71+
print output "$comma<span class=\"index-def\" title=\"'$n'\"><a name=\"propdef-$n\" class=\"propdef-title\"><strong>'$n'</strong></a></span>";
6872
}
73+
$comma = ", ";
74+
}
75+
print output "\n<dd>\n";
76+
print output "<table class=\"propinfo\" cellspacing=0 cellpadding=0>\n";
77+
print output "<tr valign=baseline>";
78+
6979
# Sorry, we use cellspacing/cellpadding until tables
7080
# handled better in user agents.
71-
print output "<TABLE class=\"propinfo\" cellspacing=0 cellpadding=0>\n";
7281
&format_values($values);
7382
&format_init($init);
7483
&format_applies($applies);
7584
&format_inherited($inherited);
7685
&format_percentages($percentages);
7786
&format_media($media);
78-
print output "</TABLE>\n";
79-
print output "</DIV>\n\n";
87+
print output "</table>\n";
88+
print output "</dl>\n";
89+
print output "</div>\n\n";
8090
}
8191

8292
# Include an nbsp before TD since CSS not used to
@@ -86,7 +96,9 @@ $values = $_[0];
8696
$values =~ s/<([^>']*)>/<span class=\"value-inst-$1\">&lt;$1&gt;<\/span>/g;
8797
$values =~ s/<[']([^']*)[']>/<span class=\"propinst-$1\">&lt;'$1'&gt;<\/span>/g;
8898
$values =~ s/inherit/<span class=\"value-inst-inherit\">inherit<\/span>/g;
89-
print output "<TR valign=\"top\"><TH align=\"right\"> Specified value:&nbsp;&nbsp;<TD>$values</TR>\n";
99+
print output "<tr valign=baseline>";
100+
print output "<td><em>Value:</em>&nbsp;&nbsp;";
101+
print output "<td>$values\n";
90102
}
91103

92104
sub format_init {
@@ -95,7 +107,9 @@ $init = $_[0];
95107
$init =~ s/XX/not defined for shorthand properties/g;
96108
$init =~ s/<([^>']*)>/<span class=\"value-inst-$1\">&lt;$1&gt;<\/span>/g;
97109
$init =~ s/<[']([^']*)[']>/<span class=\"propinst-$1\">'$1'<\/span>/g;
98-
print output "<TR valign=\"top\"><TH align=\"right\">Initial value:&nbsp;&nbsp;<TD>$init</TR>\n";
110+
print output "<tr valign=baseline>";
111+
print output "<td><em>Initial:</em>&nbsp;&nbsp;";
112+
print output "<td>$init\n";
99113
}
100114

101115
sub format_applies {
@@ -104,19 +118,25 @@ $applies = $_[0];
104118
$applies =~ s/\*/all elements/g;
105119
$applies =~ s/<([^>']*)>/<span class=\"value-inst-$1\">&lt;$1&gt;<\/span>/g;
106120
$applies =~ s/<[']([^']*)[']>/<span class=\"propinst-$1\">'$1'<\/span>/g;
107-
print output "<TR valign=\"top\"><TH align=\"right\">Applies to:&nbsp;&nbsp;<TD>$applies</TR>\n";
121+
print output "<tr valign=baseline>";
122+
print output "<td><em>Applies to:</em>&nbsp;&nbsp;";
123+
print output "<td>$applies\n";
108124
}
109125

110126
sub format_inherited {
111-
print output "<TR valign=\"top\"><TH align=\"right\">Inherited:&nbsp;&nbsp;<TD>$_[0]</TR>\n";
127+
print output "<tr valign=baseline>";
128+
print output "<td><em>Inherited:</em>&nbsp;&nbsp;";
129+
print output "<td>$_[0]\n";
112130
}
113131

114132
sub format_percentages {
115133
#Note that in the case of properties, <> are removed in text.
116134
$perc = $_[0];
117135
$perc =~ s/<([^>']*)>/<span class=\"value-inst-$1\">&lt;$1&gt;<\/span>/g;
118136
$perc =~ s/<[']([^']*)[']>/<span class=\"propinst-$1\">'$1'<\/span>/g;
119-
print output "<TR valign=\"top\"><TH align=\"right\">Percentage&nbsp;values:&nbsp;&nbsp;<TD>$perc</TR>\n";
137+
print output "<tr valign=baseline>";
138+
print output "<td><em>Percentages:</em>&nbsp;&nbsp;";
139+
print output "<td>$perc\n";
120140
}
121141

122142
sub format_media {
@@ -130,7 +150,9 @@ sub format_media {
130150
$fmedia =~ s/interactive/<a href=\"media.html#interactive-media-group\" class=\"noxref\">interactive<\/a>/;
131151
$fmedia =~ s/static/<a href=\"media.html#static-media-group\" class=\"noxref\">static<\/a>/;
132152
$fmedia =~ s/all/<a href=\"media.html#all-media-group\" class=\"noxref\">all<\/a>/;
133-
print output "<TR valign=\"top\"><TH align=\"right\">Media&nbsp;groups:&nbsp;&nbsp;<TD>$fmedia</TR>\n";
153+
print output "<tr valign=baseline>";
154+
print output "<td><em>Media:</em>&nbsp;&nbsp;";
155+
print output "<td>$fmedia\n";
134156
}
135157

136158

@@ -139,7 +161,9 @@ $_ = $buf;
139161
while (/$blockst$patt;;$patt;;$patt;;$patt;;$patt;;$patt;;$patt$blocket/s) {
140162
# Set parameters first (before any modifications)
141163
$placeholder = $';
142-
$output = "$path$1.srb";
164+
my @names = split(/[, \t\n]+/, $1);
165+
my $name = $names[0];
166+
$output = "$path$name.srb";
143167
print "\textracting $output\n";
144168
open(output, "> $output");
145169
&format_property($1, $2, $3, $4, $5, $6, $7);

css2/bin/pextr

Lines changed: 45 additions & 21 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.15 1998-03-21 21:18:11 ijacobs Exp $
16+
# $Id: pextr,v 1.16 1998-03-23 02:53:20 bbos Exp $
1717

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

@@ -52,31 +52,41 @@ $blockst = "[/][*]";
5252
$blocket = "[*][/]";
5353

5454
sub format_property {
55-
$name = $_[0];
56-
$values = $_[1];
57-
$init = $_[2];
58-
$applies = $_[3];
59-
$inherited = $_[4];
60-
$percentages = $_[5];
61-
$media = $_[6];
55+
my $name = $_[0];
56+
my $values = $_[1];
57+
my $init = $_[2];
58+
my $applies = $_[3];
59+
my $inherited = $_[4];
60+
my $percentages = $_[5];
61+
my $media = $_[6];
6262
#Do next three lines in src files to get headings right.
63-
print output "<DIV class=\"propdef\">\n";
63+
print output "<div class=\"propdef\">\n";
64+
print output "<dl><dt>\n";
65+
@names = split(/[, \t\n]+/, $name);
66+
$comma = "";
67+
foreach $n (@names) {
6468
if ($noindex) {
65-
print output "<P><a name=\"propdef-$name\" class=\"propdef-title\"><strong>'$name'</strong></a></P>\n";
69+
print output "$comma<a name=\"propdef-$n\" class=\"propdef-title\"><strong>'$n'</strong></a>";
6670
} else {
67-
print output "<P><span class=\"index-def\" title=\"'$_[0]'\"><a name=\"propdef-$name\" class=\"propdef-title\"><strong>'$name'</strong></a></span></P>\n";
71+
print output "$comma<span class=\"index-def\" title=\"'$n'\"><a name=\"propdef-$n\" class=\"propdef-title\"><strong>'$n'</strong></a></span>";
6872
}
73+
$comma = ", ";
74+
}
75+
print output "\n<dd>\n";
76+
print output "<table class=\"propinfo\" cellspacing=0 cellpadding=0>\n";
77+
print output "<tr valign=baseline>";
78+
6979
# Sorry, we use cellspacing/cellpadding until tables
7080
# handled better in user agents.
71-
print output "<TABLE class=\"propinfo\" cellspacing=0 cellpadding=0>\n";
7281
&format_values($values);
7382
&format_init($init);
7483
&format_applies($applies);
7584
&format_inherited($inherited);
7685
&format_percentages($percentages);
7786
&format_media($media);
78-
print output "</TABLE>\n";
79-
print output "</DIV>\n\n";
87+
print output "</table>\n";
88+
print output "</dl>\n";
89+
print output "</div>\n\n";
8090
}
8191

8292
# Include an nbsp before TD since CSS not used to
@@ -86,7 +96,9 @@ $values = $_[0];
8696
$values =~ s/<([^>']*)>/<span class=\"value-inst-$1\">&lt;$1&gt;<\/span>/g;
8797
$values =~ s/<[']([^']*)[']>/<span class=\"propinst-$1\">&lt;'$1'&gt;<\/span>/g;
8898
$values =~ s/inherit/<span class=\"value-inst-inherit\">inherit<\/span>/g;
89-
print output "<TR valign=\"top\"><TH align=\"right\"> Specified value:&nbsp;&nbsp;<TD>$values</TR>\n";
99+
print output "<tr valign=baseline>";
100+
print output "<td><em>Value:</em>&nbsp;&nbsp;";
101+
print output "<td>$values\n";
90102
}
91103

92104
sub format_init {
@@ -95,7 +107,9 @@ $init = $_[0];
95107
$init =~ s/XX/not defined for shorthand properties/g;
96108
$init =~ s/<([^>']*)>/<span class=\"value-inst-$1\">&lt;$1&gt;<\/span>/g;
97109
$init =~ s/<[']([^']*)[']>/<span class=\"propinst-$1\">'$1'<\/span>/g;
98-
print output "<TR valign=\"top\"><TH align=\"right\">Initial value:&nbsp;&nbsp;<TD>$init</TR>\n";
110+
print output "<tr valign=baseline>";
111+
print output "<td><em>Initial:</em>&nbsp;&nbsp;";
112+
print output "<td>$init\n";
99113
}
100114

101115
sub format_applies {
@@ -104,19 +118,25 @@ $applies = $_[0];
104118
$applies =~ s/\*/all elements/g;
105119
$applies =~ s/<([^>']*)>/<span class=\"value-inst-$1\">&lt;$1&gt;<\/span>/g;
106120
$applies =~ s/<[']([^']*)[']>/<span class=\"propinst-$1\">'$1'<\/span>/g;
107-
print output "<TR valign=\"top\"><TH align=\"right\">Applies to:&nbsp;&nbsp;<TD>$applies</TR>\n";
121+
print output "<tr valign=baseline>";
122+
print output "<td><em>Applies to:</em>&nbsp;&nbsp;";
123+
print output "<td>$applies\n";
108124
}
109125

110126
sub format_inherited {
111-
print output "<TR valign=\"top\"><TH align=\"right\">Inherited:&nbsp;&nbsp;<TD>$_[0]</TR>\n";
127+
print output "<tr valign=baseline>";
128+
print output "<td><em>Inherited:</em>&nbsp;&nbsp;";
129+
print output "<td>$_[0]\n";
112130
}
113131

114132
sub format_percentages {
115133
#Note that in the case of properties, <> are removed in text.
116134
$perc = $_[0];
117135
$perc =~ s/<([^>']*)>/<span class=\"value-inst-$1\">&lt;$1&gt;<\/span>/g;
118136
$perc =~ s/<[']([^']*)[']>/<span class=\"propinst-$1\">'$1'<\/span>/g;
119-
print output "<TR valign=\"top\"><TH align=\"right\">Percentage&nbsp;values:&nbsp;&nbsp;<TD>$perc</TR>\n";
137+
print output "<tr valign=baseline>";
138+
print output "<td><em>Percentages:</em>&nbsp;&nbsp;";
139+
print output "<td>$perc\n";
120140
}
121141

122142
sub format_media {
@@ -130,7 +150,9 @@ sub format_media {
130150
$fmedia =~ s/interactive/<a href=\"media.html#interactive-media-group\" class=\"noxref\">interactive<\/a>/;
131151
$fmedia =~ s/static/<a href=\"media.html#static-media-group\" class=\"noxref\">static<\/a>/;
132152
$fmedia =~ s/all/<a href=\"media.html#all-media-group\" class=\"noxref\">all<\/a>/;
133-
print output "<TR valign=\"top\"><TH align=\"right\">Media&nbsp;groups:&nbsp;&nbsp;<TD>$fmedia</TR>\n";
153+
print output "<tr valign=baseline>";
154+
print output "<td><em>Media:</em>&nbsp;&nbsp;";
155+
print output "<td>$fmedia\n";
134156
}
135157

136158

@@ -139,7 +161,9 @@ $_ = $buf;
139161
while (/$blockst$patt;;$patt;;$patt;;$patt;;$patt;;$patt;;$patt$blocket/s) {
140162
# Set parameters first (before any modifications)
141163
$placeholder = $';
142-
$output = "$path$1.srb";
164+
my @names = split(/[, \t\n]+/, $1);
165+
my $name = $names[0];
166+
$output = "$path$name.srb";
143167
print "\textracting $output\n";
144168
open(output, "> $output");
145169
&format_property($1, $2, $3, $4, $5, $6, $7);

0 commit comments

Comments
 (0)