The R Project SVN R

Rev

Rev 47125 | Rev 47442 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 47125 Rev 47254
Line 1... Line 1...
1
#! @PERL@
1
#! @PERL@
2
 
2
 
3
## Convert R documentation into HTML, LaTeX and text format
3
## Convert R documentation into HTML, LaTeX and text format
4
 
4
 
5
# Copyright (C) 1997 Friedrich Leisch
5
# Copyright (C) 1997 Friedrich Leisch
6
# Copyright (C) 2000-4 The R Core Development Team
6
# Copyright (C) 2000-8 The R Core Development Team
7
#
7
#
8
# This program is free software; you can redistribute it and/or modify
8
# This program is free software; you can redistribute it and/or modify
9
# it under the terms of the GNU General Public License as published by
9
# it under the terms of the GNU General Public License as published by
10
# the Free Software Foundation; either version 2, or (at your option)
10
# the Free Software Foundation; either version 2, or (at your option)
11
# any later version.
11
# any later version.
Line 23... Line 23...
23
use Getopt::Long;
23
use Getopt::Long;
24
use R::Rdconv;
24
use R::Rdconv;
25
use R::Utils;
25
use R::Utils;
26
use R::Vars;
26
use R::Vars;
27
 
27
 
28
my $revision = ' $Rev: 47125 $ ';
28
my $revision = ' $Rev: 47254 $ ';
29
my $version;
29
my $version;
30
my $name;
30
my $name;
31
 
31
 
32
## switch on autoflushing for STDOUT.  We want this as we
32
## switch on autoflushing for STDOUT.  We want this as we
33
## write to both STDERR (warnings) and STDOUT.
33
## write to both STDERR (warnings) and STDOUT.
Line 64... Line 64...
64
$enc = $opt_encoding if $opt_encoding;
64
$enc = $opt_encoding if $opt_encoding;
65
 
65
 
66
my %types_and_exts = ("txt", "",
66
my %types_and_exts = ("txt", "",
67
		      "html", ".html",
67
		      "html", ".html",
68
		      "latex", ".tex",
68
		      "latex", ".tex",
69
		      "Sd", ".d",
-
 
70
		      "Ssgm", ".sgml",
-
 
71
		      "example", ".R");
69
		      "example", ".R");
72
 
70
 
73
my $opt_type_ok = 0;
71
my $opt_type_ok = 0;
74
 
72
 
75
foreach my $type (keys(%types_and_exts)) {
73
foreach my $type (keys(%types_and_exts)) {
Line 104... Line 102...
104
  -o, --output=OUT	use 'OUT' as the output file
102
  -o, --output=OUT	use 'OUT' as the output file
105
      --os=NAME		use OS subdir 'NAME' (unix or windows)
103
      --os=NAME		use OS subdir 'NAME' (unix or windows)
106
      --OS=NAME		the same as '--os'
104
      --OS=NAME		the same as '--os'
107
 
105
 
108
Possible format specifications are 'txt' (plain text), 'html', 'latex',
106
Possible format specifications are 'txt' (plain text), 'html', 'latex',
109
'Sd' (old S documentation format), 'Ssgm' (new S documentation format),
-
 
110
and 'example' (extract R code in the examples).
107
and 'example' (extract R code in the examples).
111
 
108
 
112
The default is to send output to stdout, which is also given by '-o -'.
109
The default is to send output to stdout, which is also given by '-o -'.
113
Using '-o ""' will choose an output filename by removing a '.Rd'
110
Using '-o ""' will choose an output filename by removing a '.Rd'
114
extension from FILE and adding a suitable extension.
111
extension from FILE and adding a suitable extension.