Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

added --linkcolor option, fixed --version and --help

darcs-hash:20070124022653-0f649-ff75dc56ba48a1c0aa661bf3c3a4ab96e30e714a.gz
  • Loading branch information...
commit 6ea32ffe3422551483398e4560b0d6fdfc9a47eb 1 parent 9f1e485
John MacFarlane authored January 23, 2007

Showing 1 changed file with 18 additions and 13 deletions. Show diff stats Hide diff stats

  1. 31  sep-offprint
31  sep-offprint
@@ -2,9 +2,10 @@
2 2
 #
3 3
 # sep-offprint 0.7 - John MacFarlane - January 23, 2007
4 4
 #   + include supplements, if present (thanks to Dan Robins)
5  
-#   + hyperlinks now marked in blue (Dan Robins)
6 5
 #   + removed unnecessary call to lwp-rget (Dan Robins)
  6
+#   + added --linkcolor option (JM and Dan Robins)
7 7
 #   + added error checking:  error exit if index.html not found
  8
+#   + fixed '--version' and adjusted '--help' output
8 9
 #
9 10
 # sep-offprint 0.6 - John MacFarlane - August 30, 2006
10 11
 # sep-offprint 0.5 - John MacFarlane - August 25, 2006
@@ -39,6 +40,8 @@
39 40
 # For more information and updates, see 
40 41
 # http://philosophy.berkeley.edu/macfarlane/sep-offprint.html
41 42
 
  43
+my $version_number = '0.7';
  44
+
42 45
 use Getopt::Long;
43 46
 use File::Temp qw/ tempdir /;
44 47
 use File::Copy;
@@ -52,21 +55,20 @@ sub printhelp {
52 55
 Usage:                 sep-offprint [options] <entry name>
53 56
 
54 57
 Examples:              sep-offprint russell
55  
-                       sep-offprint frege russell wittgenstein
56 58
                        sep-offprint --1up --ps --paper a4 frege
57  
-                       sep-offprint --1up --fontfamily Helvetica frege
58 59
 
59  
-Options:
  60
+Options (* indicates a default):
60 61
 
61 62
 --1up                  print one page per sheet, portrait orientation
62  
---2up                  print two pages per sheet, landscape orientation (default) 
  63
+--2up                  print two pages per sheet, landscape orientation*
63 64
 --ps                   produce postscript (PS) output
64  
---pdf                  produce PDF output (default)
65  
---font <font>          use <font> (Times, Helvetica, Palatino, Courier) (default Times)
66  
---size <size>          use <size> (10pt, 12pt, 14pt, 16pt) (default 14pt)
67  
---align <align>        use <align> (left, justified) (default justified)
68  
---paper <papersize>    specify <papersize> (letter, legal, a4) (default letter)
69  
---localpath <path>     look for entry in a subdirectory of <path> on local filesystem
  65
+--pdf                  produce PDF output*
  66
+--font <font>          use <font> (Times*, Helvetica, Palatino, Courier)
  67
+--size <size>          use <size> (10pt, 12pt, 14pt*, 16pt)
  68
+--align <align>        use <align> (left, justified*)
  69
+--paper <papersize>    specify <papersize> (letter*, legal, a4)
  70
+--linkcolor <color>    specify color of hyperlinks (black*, gray, blue, ...)
  71
+--localpath <path>     look for entry in a subdirectory of <path> 
70 72
 --help                 this message
71 73
 --version              prints version number\n";
72 74
 }
@@ -79,10 +81,13 @@ GetOptions( '1up|1' => \$oneup,
79 81
             'size=s' => \$fontsize,
80 82
             'align=s' => \$textalign,
81 83
             'paper=s' => \$papersize,
  84
+            'linkcolor=s' => \$linkcolor,
82 85
             'localpath=s' => \$localpath,
83 86
             'help|h' => \$help,
84 87
             'version|v' => \$version);
85 88
 
  89
+if ($version) {die "sep-offprint $version_number\n";}; 
  90
+
86 91
 if ($#ARGV < 0) {&printhelp;};
87 92
 $entryname = $ARGV[0];
88 93
 
@@ -96,13 +101,13 @@ $entryname =~ s{http://plato.stanford.edu/entries/}{};
96 101
 $entryname =~ s{/.*}{};
97 102
 
98 103
 if ($help) {&printhelp;};
99  
-if ($version) {die "sep-offprint ver. 0.6\n";}; 
100 104
 if (not ($pdf or $ps)) {$pdf=1};
101 105
 if ($oneup) {$twoup = 0} else {$twoup = 1};
102 106
 if (not $fontsize) {$fontsize = "14pt"};
103 107
 if (not $fontfamily) {$fontfamily = "Times"};
104 108
 if (not $textalign) {$textalign = "justify"};
105 109
 if (not $papersize) {$papersize = "letter"};
  110
+if (not $linkcolor) {$linkcolor = "black"};
106 111
 
107 112
 $temp = tempdir ( CLEANUP => 1 );
108 113
 
@@ -161,7 +166,7 @@ BODY {
161 166
     text-align: $textalign; 
162 167
 }
163 168
 A:link {
164  
-    color: blue;
  169
+    color: $linkcolor;
165 170
 }
166 171
 \@page { 
167 172
     margin-left: 2.5cm; 

0 notes on commit 6ea32ff

Please sign in to comment.
Something went wrong with that request. Please try again.