8000 [css2] . · w3c/csswg-drafts@40b9a3a · GitHub
Skip to content

Commit 40b9a3a

Browse files
committed
[css2] .
--HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%4026
1 parent 769dad0 commit 40b9a3a

12 files changed

Lines changed: 669 additions & 21 deletions

File tree

css2/Attic/conform.src

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE HTML SYSTEM "http://www.w3.org/TR/WD-html40/sgml/HTML4.dtd">
22
<html lang="en">
3-
<!-- $Id: conform.src,v 1.2 1997-07-30 12:11:48 ijacobs Exp $ -->
3+
<!-- $Id: conform.src,v 1.3 1997-08-05 17:31:02 ijacobs Exp $ -->
44
<HEAD>
55
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
66
<TITLE>CSS2 Conformance</TITLE>
@@ -10,5 +10,7 @@
1010
</HEAD>
1111
<BODY>
1212
<H1 align="center">CSS2 Conformance</H1>
13+
<!-- Core conformance? All CSS1 stuff is *required* for conformance
14+
in CSS2 -->
1315
</BODY>
1416
</HTML>

css2/DOC/FILES

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ selector.src
1313
cascade.src
1414
media.src
1515
flowobj.src
16+
flowobj2.src
1617
colors.src
1718
fonts.src
1819
text.src
19-
boxmodel.src
2020
ui.src
2121

2222
conform.src

css2/Makefile

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Makefile to generate the CSS2 document based on its "source files"
22
# Arnaud Le Hors - lehors@w3.org
3-
# $Id: Makefile,v 1.5 1997-08-01 17:02:09 ijacobs Exp $
3+
# $Id: Makefile,v 1.6 1997-08-05 17:30:45 ijacobs Exp $
44

55
ROOT = .
66

@@ -20,10 +20,10 @@ selector.src\
2020
cascade.src\
2121
media.src\
2222
flowobj.src\
23+
flowobj2.src\
2324
colors.src\
2425
fonts.src\
2526
text.src\
26-
boxmodel.src\
2727
ui.src\
2828
conform.src \
2929
refs.src
@@ -52,10 +52,10 @@ selector.html\
5252
cascade.html\
5353
media.html\
5454
flowobj.html\
55+
flowobj2.html\
5556
colors.html\
5657
fonts.html\
5758
text.html\
58-
boxmodel.html\
5959
ui.html\
6060
conform.html\
6161
refs.html
@@ -108,6 +108,10 @@ MKIDX= $(PERL) ./bin/mkidx
108108
MKTOC= $(PERL) ./bin/mktoc
109109
# HTML concate utility
110110
HTMLCAT= $(PERL) ./bin/htmlcat
111+
# make sub table of contents
112+
MKSUBTOC= $(PERL) ./bin/mksubtoc
113+
# insert subtoc
114+
INSAFTER= $(PERL) ./bin/insafter
111115

112116
# utility to generate the PostScript version
113117
HTML2PSARGS= -n -D -R
@@ -125,10 +129,17 @@ LN= ln
125129
.SUFFIXES: .src .html .srb
126130

127131
.src.html:
128-
@if [ ! -d build/index ]; then mkdir -p build/index;fi
132+
@if [ ! -d build/index ]; then mkdir -p build/index; fi
133+
echo "<div class=\"subtoc\"><p><strong>Contents</strong>" \
134+
> build/subtoc.$$$$; \
135+
$(MKSUBTOC) -r $@ -l 2 - $(HEADINGDB) $< >> build/subtoc.$$$$; \
136+
echo "</div>" >> build/subtoc.$$$$; \
129137
$(HIPP) $(INCLUDES) $< - | $(ADDHANCH) -r $< - - $(HEADINGDB) | \
130138
$(ADDIDXANCH) -r $< - - build/index/$<.db | \
131-
$(ADDNAVBAR) -r $@ - $@ contents "cover.html#toc" index index.html
139+
$(ADDNAVBAR) -r $@ - - contents "cover.html#toc" index index.html| \
140+
$(INSAFTER) - build/subtoc.$$$$ /H1 $@; \
141+
$(RM) build/subtoc.$$$$
142+
132143

133144
all: $(PROPERTYDB) $(VALUEDB) $(HEADINGDB) $(SPECOBJS) $(INDEXES)
134145

css2/bin/Attic/insafter

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/local/bin/perl
2+
# Insert some file after the first occurence of a given tag
3+
#
4+
# Arnaud Le Hors - lehors@w3.org
5+
# $Id: insafter,v 1.1 1997-08-05 17:31:53 ijacobs Exp $
6+
7+
$PROGNAME = substr($0, rindex($0, "/") + 1);
8+
9+
if ($#ARGV < 3) {
10+
print "Usage: $PROGNAME src src2 tag trgt\n";
11+
exit 1;
12+
} else {
13+
$input = $ARGV[0];
14+
$input2 = $ARGV[1];
15+
$tag = $ARGV[2];
16+
$output = $ARGV[3];
17+
}
18+
19+
20+
### main
21+
22+
if (!open(INPUT, $input)) {
23+
print STDERR "$PROGNAME Error: Cannot open file: $input\n";
24+
exit 1;
25+
}
26+
if (!open(INPUT2, $input2)) {
27+
print STDERR "$PROGNAME Error: Cannot open file: $input2\n";
28+
exit 1;
29+
}
30+
open(OUTPUT, "> $output");
31+
LOOP: while (<INPUT>) {
32+
print OUTPUT $_;
33+
if (/<$tag>/i) {
34+
while (<INPUT2>) {
35+
print OUTPUT $_;
36+
}
37+
last LOOP;
38+
}
39+
}
40+
while (<INPUT>) {
41+
print OUTPUT $_;
42+
}
43+
close(INPUT);
44+
close(INPUT2);
45+
close(OUTPUT);

css2/bin/Attic/mksubtoc

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
#!/usr/local/bin/perl
2+
# sub TOC builder
3+
#
4+
# Arnaud Le Hors - lehors@w3.org
5+
# $Id: mksubtoc,v 1.1 1997-08-05 17:31:59 ijacobs Exp $
6+
7+
if (($_ = $ARGV[0], /^-r/) && $ARGV[0]) {
8+
shift;
9+
$realpath = $ARGV[0];
10+
shift;
11+
} else {
12+
$realpath = ();
13+
}
14+
15+
if (($_ = $ARGV[0], /^-l/) && $ARGV[0]) {
16+
shift;
17+
$startlvl = $ARGV[0] - 1;
18+
shift;
19+
} else {
20+
$startlvl = 0;
21+
}
22+
23+
$PROGNAME = substr($0, rindex($0, "/") + 1);
24+
25+
if ($#ARGV < 2) {
26+
print STDERR "Usage: $PROGNAME [ -r realpath ] [ -l startlvl ] subtoc headingdb src1 src2 ...\n";
27+
exit 1;
28+
} else {
29+
$tocf = $ARGV[0];
30+
shift;
31+
if (! $realpath) {
32+
$realpath = $tocf;
33+
}
34+
$hdbasef = $ARGV[0];
35+
shift;
36+
}
37+
38+
# compute relative path from 1 to 2
39+
sub rpath {
40+
@path1 = split("/", $_[0]);
41+
@path2 = split("/", $_[1]);
42+
43+
pop(@path1);
44+
while ($path1[0] eq $path2[0]) {
45+
shift(@path1);
46+
shift(@path2);
47+
}
48+
49+
$root = "";
50+
foreach $el (@path1) {
51+
$root .= "../";
52+
}
53+
$path = join("/", @path2);
54+
return "$root$path";
55+
}
56+
57+
# copy file in memory
58+
sub readfile {
59+
$buf = "";
60+
if (!open(INPUT, $_[0])) {
61+
print STDERR "$PROGNAME Error: Cannot open file: $_[0]\n";
62+
return;
63+
}
64+
while (<INPUT>) {
65+
$buf .= $_;
66+
}
67+
close(INPUT);
68+
}
69+
70+
sub olinit {
71+
@ol = ();
72+
$ol[0] = 0;
73+
}
74+
75+
sub ol {
76+
# args: $h
77+
$hn = $_[0] - 1;
78+
for ($i = $#n; $i > $hn; $i--) {
79+
if ($ol[$i] != 0) {
80+
print OUTPUT "</ol>\n";
81+
$ol[$i] = 0;
82+
}
83+
$n[$i] = 0;
84+
}
85+
if ($hn >= 0) {
86+
if ($ol[$hn] == 0) {
87+
print OUTPUT "<ol>\n";
88+
$ol[$hn] = 1;
89+
}
90+
$n[$hn]++;
91+
}
92+
}
93+
94+
# remove every possible anchor
95+
sub cleanup {
96+
$text = $_[0];
97+
$text =~ s/<a(.*?)>//sgi;
98+
$text =~ s/<\/a>//sgi;
99+
return $text;
100+
}
101+
102+
103+
### main
104+
105+
# read heading database
106+
readfile($hdbasef);
107+
108+
# search for all the headings related to the given files and build the toc
109+
open(OUTPUT, "> $tocf");
110+
olinit();
111+
foreach $file (@ARGV) {
112+
# change extension
113+
$hfil = $file;
114+
$hfil =~ s/\.src/\.html/;
115+
$rpath = rpath($realpath, $hfil);
116+
$_ = $buf;
117+
while (/$file;(.*?);([0-9]*);([1-9].*?)\n/si) {
118+
$t = $1;
119+
$h = int($2);
120+
if ($h > $startlvl && $h < 4) {
121+
$num = $3;
122+
ol($h);
123+
if ($h == 1) { # if H1 go to the top of the page and set rel
124+
$url = "$rpath";
125+
$rel= " rel=\"section\"";
126+
} else {
127+
$url = "$rpath#h-$num";
128+
$rel = "";
129+
}
130+
$txt = cleanup($t);
131+
print OUTPUT "<li><a href=\"$url\"$rel>$txt</a>\n";
132+
}
133+
$_ = $';
134+
}
135+
}
136+
ol(0); # close all open lists
137+
close(OUTPUT);

css2/bin/insafter

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/local/bin/perl
2+
# Insert some file after the first occurence of a given tag
3+
#
4+
# Arnaud Le Hors - lehors@w3.org
5+
# $Id: insafter,v 1.1 1997-08-05 17:31:53 ijacobs Exp $
6+
7+
$PROGNAME = substr($0, rindex($0, "/") + 1);
8+
9+
if ($#ARGV < 3) {
10+
print "Usage: $PROGNAME src src2 tag trgt\n";
11+
exit 1;
12+
} else {
13+
$input = $ARGV[0];
14+
$input2 = $ARGV[1];
15+
$tag = $ARGV[2];
16+
$output = $ARGV[3];
17+
}
18+
19+
20+
### main
21+
22+
if (!open(INPUT, $input)) {
23+
print STDERR "$PROGNAME Error: Cannot open file: $input\n";
24+
exit 1;
25+
}
26+
if (!open(INPUT2, $input2)) {
27+
print STDERR "$PROGNAME Error: Cannot open file: $input2\n";
28+
exit 1;
29+
}
30+
open(OUTPUT, "> $output");
31+
LOOP: while (<INPUT>) {
32+
print OUTPUT $_;
33+
if (/<$tag>/i) {
34+
while (<INPUT2>) {
35+
print OUTPUT $_;
36+
}
37+
last LOOP;
38+
}
39+
}
40+
while (<INPUT>) {
41+
print OUTPUT $_;
42+
}
43+
close(INPUT);
44+
close(INPUT2);
45+
close(OUTPUT);

0 commit comments

Comments
 (0)