Skip to content

Commit 3a377cd

Browse files
committed
[css2] Added class=noxref to some generated links, and modified style to look
at class normref/informref when it is on a SPAN as well as on an A. --HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%40918
1 parent 612ca55 commit 3a377cd

4 files changed

Lines changed: 14 additions & 12 deletions

File tree

css2/bin/Attic/addcite

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# is used as prefix.
1616
#
1717
# Bert Bos <bert@w3.org>
18-
# $Id: addcite,v 2.1 1998-02-10 17:42:26 bbos Exp $
18+
# $Id: addcite,v 2.2 1998-02-16 23:40:23 bbos Exp $
1919

2020
use Getopt::Std;
2121
use lib 'bin';
@@ -77,7 +77,7 @@ while ($buf =~ /\[\[(-)?(\S+?)\]\]/so) {
7777
$class = $refclass{$key};
7878
}
7979
print OUT "<a href=\"$prefix#$refanch{$key}\" rel=\"biblioentry\" ";
80-
print OUT "class=\"$class\">[$key]</a>";
80+
print OUT "class=\"noxref\"><span class=\"$class\">[$key]</span></a>";
8181
}
8282
}
8383

css2/bin/Attic/addlinks

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Write to stdout
44
#
55
# Arnaud Le Hors - lehors@w3.org
6-
# $Id: addlinks,v 2.1 1998-02-10 17:49:23 bbos Exp $
6+
# $Id: addlinks,v 2.2 1998-02-16 23:40:26 bbos Exp $
77

88
use lib 'bin';
99
use utils;
@@ -43,20 +43,21 @@ sub gen_anch {
4343
warn "$PROG: index $_[0] not found\n";
4444
$anch = "";
4545
}
46+
# class=noxref directs our patched html2ps to omit the page number
4647
if ($content =~ /^<a\s[^>]*?href\s*=/sio) {
4748
# An A with an HREF at the start, give up...
4849
warn "$PROG: cannot add link to \"$anch\", there is a link already:
4950
\t$content\n";
5051
return "$stag$content$etag";
5152
} elsif ($content =~ /^<a\b/sio) {
5253
# An A, but without HREF, at the start, add HREF to existing <A>
53-
return "$stag<a href=\"$anch\"$'$etag";
54+
return "$stag<a href=\"$anch\" class=\"noxref\"$'$etag";
5455
} elsif ($content =~ /<a\b/sio) {
5556
# An A not at the start, add <A> before the existing one
56-
return "$stag<a href=\"$anch\">$`</a>$&$'$etag";
57+
return "$stag<a href=\"$anch\" class=\"noxref\">$`</a>$&$'$etag";
5758
} else {
5859
# No <A> in content, enclose whole element
59-
return "<a href=\"$anch\">$stag$content$etag</a>";
60+
return "<a href=\"$anch\" class=\"noxref\">$stag$content$etag</a>";
6061
}
6162
}
6263

css2/bin/addcite

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# is used as prefix.
1616
#
1717
# Bert Bos <bert@w3.org>
18-
# $Id: addcite,v 2.1 1998-02-10 17:42:26 bbos Exp $
18+
# $Id: addcite,v 2.2 1998-02-16 23:40:23 bbos Exp $
1919

2020
use Getopt::Std;
2121
use lib 'bin';
@@ -77,7 +77,7 @@ while ($buf =~ /\[\[(-)?(\S+?)\]\]/so) {
7777
$class = $refclass{$key};
7878
}
7979
print OUT "<a href=\"$prefix#$refanch{$key}\" rel=\"biblioentry\" ";
80-
print OUT "class=\"$class\">[$key]</a>";
80+
print OUT "class=\"noxref\"><span class=\"$class\">[$key]</span></a>";
8181
}
8282
}
8383

css2/bin/addlinks

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Write to stdout
44
#
55
# Arnaud Le Hors - lehors@w3.org
6-
# $Id: addlinks,v 2.1 1998-02-10 17:49:23 bbos Exp $
6+
# $Id: addlinks,v 2.2 1998-02-16 23:40:26 bbos Exp $
77

88
use lib 'bin';
99
use utils;
@@ -43,20 +43,21 @@ sub gen_anch {
4343
warn "$PROG: index $_[0] not found\n";
4444
$anch = "";
4545
}
46+
# class=noxref directs our patched html2ps to omit the page number
4647
if ($content =~ /^<a\s[^>]*?href\s*=/sio) {
4748
# An A with an HREF at the start, give up...
4849
warn "$PROG: cannot add link to \"$anch\", there is a link already:
4950
\t$content\n";
5051
return "$stag$content$etag";
5152
} elsif ($content =~ /^<a\b/sio) {
5253
# An A, but without HREF, at the start, add HREF to existing <A>
53-
return "$stag<a href=\"$anch\"$'$etag";
54+
return "$stag<a href=\"$anch\" class=\"noxref\"$'$etag";
5455
} elsif ($content =~ /<a\b/sio) {
5556
# An A not at the start, add <A> before the existing one
56-
return "$stag<a href=\"$anch\">$`</a>$&$'$etag";
57+
return "$stag<a href=\"$anch\" class=\"noxref\">$`</a>$&$'$etag";
5758
} else {
5859
# No <A> in content, enclose whole element
59-
return "<a href=\"$anch\">$stag$content$etag</a>";
60+
return "<a href=\"$anch\" class=\"noxref\">$stag$content$etag</a>";
6061
}
6162
}
6263

0 commit comments

Comments
 (0)