Skip to content

Commit 51087b2

Browse files
committed
[css2] Now incorporates Arnaud's latest fixes, including his use of
class="tocxref" to cause the cross-reference page number to be inserted at the end of dot leaders. --HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%401643
1 parent f60e6ef commit 51087b2

2 files changed

Lines changed: 58 additions & 6 deletions

File tree

css2/bin/Attic/html2ps

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
22
eval 'exec perl -S $0 "$@"'
33
if $running_under_some_shell;
44

5+
#
6+
# This is version has been patched by Arnaud Le Hors 1997 - lehors@w3.org
7+
# Changes are:
8+
# - fixed bug in cross references (some weren't generated)
9+
# - added some comments, many more would be nice though!...
10+
# - use less memory:
11+
# every file is processed in memory and then appended to a temp file
12+
# - DIVs of class 'navbar' are not "printed out"
13+
# - replace links of class 'index-inst' by the corresponding page number
14+
# - replace links of class 'index-def' by the corresponding page number in bold
15+
# - force old toc style (".....<page #>") for links of class 'tocxref'
16+
# - force modern toc style (", <page #>") for links of class 'toc-link'
17+
# - no xref is added on links of class 'noxref'
18+
#
19+
20+
#
521
# This is html2ps version 1.0 beta1, an HTML-to-PostScript converter.
622
# Copyright (C) 1995-1997 Jan Karrman.
723
#
@@ -370,7 +386,7 @@ $space=join('|',keys %space);
370386
"archb",30.5, "archa",22.9, "flsa",21.6, "flse",21.6, "halfletter",14,
371387
"11x17",27.9, "ledger",43.2);
372388

373-
$version="html2ps version 1.0 beta1";
389+
$version="html2ps version 1.0 beta1 patched by Arnaud Le Hors";
374390
$opts="2|b:|c|C:|d|D|e:|f:|F|g|h|H|i:|l:|L|m:|n|N:|o:|O|r:|R|s:|S:|T|u|U|v|W:|"
375391
."x:";
376392
%optalias=( 'twoup','2', 'base','b', 'check','c', 'toc','C', 'debug','d',
@@ -2672,10 +2688,16 @@ sub Subst{
26722688
# add page reference unless class of anchor is "noxref"
26732689
($acl)=$tag=~/class\s*=\s*($S)/i?$+:"";
26742690
if(grep(/^index-def$/i,split(/\s+/,$acl))) {
2691+
# replace anchor by the page number in bold
26752692
$rest=~s|.*?</a>|)BD()$refs{$lnk} $ltype ITN TL()Ec /AF f D() ES(|i;
26762693
} elsif(grep(/^index-inst$/i,split(/\s+/,$acl))) {
2694+
# replace anchor by the page number
26772695
$rest=~s|.*?</a>|)$refs{$lnk} $ltype ITN TL()Ec /AF f D(|i;
2696+
} elsif(grep(/^tocxref$/i,split(/\s+/,$acl))) {
2697+
# add page number to anchor with a TOC style ($ltype = 1)
2698+
$rest=~s|</a>|)$refs{$lnk} 1 TN TL()Ec /AF f D(|i;
26782699
} elsif(grep(/^toc-link/i,split(/\s+/,$acl))) {
2700+
# add a comma + space + page number to anchor
26792701
$rest=~s|</a>|, ) $refs{$lnk} $ltype ITN TL()Ec /AF f D(|i;
26802702
} elsif(!grep(/^noxref$/i,split(/\s+/,$acl))) {
26812703
$rest=~s|</a>|)$refs{$lnk} $ltype TN TL()Ec /AF f D(|i;
@@ -3826,9 +3848,13 @@ sub DSC {
38263848
last S;
38273849
}
38283850
if($line=~/^\[(.*) (\d+) $io\]$/) {
3829-
$li=$BM[$ix[$2]]=~y/\n/\n/+2;
3851+
$li=$BM[$2]=~y/\n/\n/+2;
3852+
# the above Arnaud's line; this is the old:
3853+
# $li=$BM[$ix[$2]]=~y/\n/\n/+2;
38303854
$line="\/picstr $WS[$ix[$2]] string D\n$1\n"
3831-
."%%BeginData: $li Hex Lines\n$val[$3]\n$BM[$ix[$2]]\n%%EndData";
3855+
."%%BeginData: $li Hex Lines\n$val[$3]\n$BM[$2]\n%%EndData";
3856+
# The above is Arnaud's line, this is the old:
3857+
# ."%%BeginData: $li Hex Lines\n$val[$3]\n$BM[$ix[$2]]\n%%EndData";
38323858
last S;
38333859
}
38343860
if($line=~/^\((.*)\)$/) {

css2/bin/html2ps

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
22
eval 'exec perl -S $0 "$@"'
33
if $running_under_some_shell;
44

5+
#
6+
# This is version has been patched by Arnaud Le Hors 1997 - lehors@w3.org
7+
# Changes are:
8+
# - fixed bug in cross references (some weren't generated)
9+
# - added some comments, many more would be nice though!...
10+
# - use less memory:
11+
# every file is processed in memory and then appended to a temp file
12+
# - DIVs of class 'navbar' are not "printed out"
13+
# - replace links of class 'index-inst' by the corresponding page number
14+
# - replace links of class 'index-def' by the corresponding page number in bold
15+
# - force old toc style (".....<page #>") for links of class 'tocxref'
16+
# - force modern toc style (", <page #>") for links of class 'toc-link'
17+
# - no xref is added on links of class 'noxref'
18+
#
19+
20+
#
521
# This is html2ps version 1.0 beta1, an HTML-to-PostScript converter.
622
# Copyright (C) 1995-1997 Jan Karrman.
723
#
@@ -370,7 +386,7 @@ $space=join('|',keys %space);
370386
"archb",30.5, "archa",22.9, "flsa",21.6, "flse",21.6, "halfletter",14,
371387
"11x17",27.9, "ledger",43.2);
372388

373-
$version="html2ps version 1.0 beta1";
389+
$version="html2ps version 1.0 beta1 patched by Arnaud Le Hors";
374390
$opts="2|b:|c|C:|d|D|e:|f:|F|g|h|H|i:|l:|L|m:|n|N:|o:|O|r:|R|s:|S:|T|u|U|v|W:|"
375391
."x:";
376392
%optalias=( 'twoup','2', 'base','b', 'check','c', 'toc','C', 'debug','d',
@@ -2672,10 +2688,16 @@ sub Subst{
26722688
# add page reference unless class of anchor is "noxref"
26732689
($acl)=$tag=~/class\s*=\s*($S)/i?$+:"";
26742690
if(grep(/^index-def$/i,split(/\s+/,$acl))) {
2691+
# replace anchor by the page number in bold
26752692
$rest=~s|.*?</a>|)BD()$refs{$lnk} $ltype ITN TL()Ec /AF f D() ES(|i;
26762693
} elsif(grep(/^index-inst$/i,split(/\s+/,$acl))) {
2694+
# replace anchor by the page number
26772695
$rest=~s|.*?</a>|)$refs{$lnk} $ltype ITN TL()Ec /AF f D(|i;
2696+
} elsif(grep(/^tocxref$/i,split(/\s+/,$acl))) {
2697+
# add page number to anchor with a TOC style ($ltype = 1)
2698+
$rest=~s|</a>|)$refs{$lnk} 1 TN TL()Ec /AF f D(|i;
26782699
} elsif(grep(/^toc-link/i,split(/\s+/,$acl))) {
2700+
# add a comma + space + page number to anchor
26792701
$rest=~s|</a>|, ) $refs{$lnk} $ltype ITN TL()Ec /AF f D(|i;
26802702
} elsif(!grep(/^noxref$/i,split(/\s+/,$acl))) {
26812703
$rest=~s|</a>|)$refs{$lnk} $ltype TN TL()Ec /AF f D(|i;
@@ -3826,9 +3848,13 @@ sub DSC {
38263848
last S;
38273849
}
38283850
if($line=~/^\[(.*) (\d+) $io\]$/) {
3829-
$li=$BM[$ix[$2]]=~y/\n/\n/+2;
3851+
$li=$BM[$2]=~y/\n/\n/+2;
3852+
# the above Arnaud's line; this is the old:
3853+
# $li=$BM[$ix[$2]]=~y/\n/\n/+2;
38303854
$line="\/picstr $WS[$ix[$2]] string D\n$1\n"
3831-
."%%BeginData: $li Hex Lines\n$val[$3]\n$BM[$ix[$2]]\n%%EndData";
3855+
."%%BeginData: $li Hex Lines\n$val[$3]\n$BM[$2]\n%%EndData";
3856+
# The above is Arnaud's line, this is the old:
3857+
# ."%%BeginData: $li Hex Lines\n$val[$3]\n$BM[$ix[$2]]\n%%EndData";
38323858
last S;
38333859
}
38343860
if($line=~/^\((.*)\)$/) {

0 commit comments

Comments
 (0)