The R Project SVN R

Rev

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

Rev 12778 Rev 13792
Line 20... Line 20...
20
# Suite 330, Boston, MA  02111-1307  USA.
20
# Suite 330, Boston, MA  02111-1307  USA.
21
 
21
 
22
use Getopt::Long;
22
use Getopt::Long;
23
use R::Utils;
23
use R::Utils;
24
 
24
 
25
my $revision = ' $Revision: 1.19 $ ';
25
my $revision = ' $Revision: 1.20 $ ';
26
my $version;
26
my $version;
27
my $name;
27
my $name;
28
 
28
 
29
$revision =~ / ([\d\.]*) /;
29
$revision =~ / ([\d\.]*) /;
30
$version = $1;
30
$version = $1;
Line 59... Line 59...
59
## S3-style (nroff) or S4-style (SGML spec).
59
## S3-style (nroff) or S4-style (SGML spec).
60
if(@lines[0] =~ /^<!doctype/) { doS4(); } else { doS3(); }
60
if(@lines[0] =~ /^<!doctype/) { doS4(); } else { doS3(); }
61
exit 0;
61
exit 0;
62
 
62
 
63
sub doS3 {
63
sub doS3 {
64
  my $braceLevel = 0;
64
  $braceLevel = 0;
65
  my $inReferences = 0;
65
  $inReferences = 0;
66
  my $inVerbatim = 0;
66
  $inVerbatim = 0;
67
  my $inSeeAlso = 0;
67
  $inSeeAlso = 0;
68
  my $inCode = 0;
68
  $inCode = 0;
69
  my $isDataSet = 0;
69
  $isDataSet = 0;
70
  my $doprint = 1;
70
  $doprint = 1;
71
  my $needArg = 1;
71
  $needArg = 1;
72
  my $needVal = 0;
72
  $needVal = 0;
73
  my $underlineNext = 0;
73
  $underlineNext = 0;
74
  my $output = "";
74
  $output = "";
75
 
75
 
76
  foreach $_ (@lines) {
76
  foreach $_ (@lines) {
77
    chop;
77
    chop;
78
    &substitute unless /^\./;
78
    &substitute unless /^\./;
79
    my @word = split;
79
    my @word = split;
Line 174... Line 174...
174
	&section(0, "\\source\{");
174
	&section(0, "\\source\{");
175
	$inReferences = 1;
175
	$inReferences = 1;
176
      } elsif ($word[1] =~ /SUMMARY/) {
176
      } elsif ($word[1] =~ /SUMMARY/) {
177
	&section(0, "\\description\{");
177
	&section(0, "\\description\{");
178
      } elsif ($word[1] =~ /Warning/) {
178
      } elsif ($word[1] =~ /Warning/) {
179
	&section(0, "\\secion{Warning}\{");
179
	&section(0, "\\section{Warning}\{");
180
      } elsif (join(" ", @word[1..2]) =~ /DATA DESCRIPTION/) {
180
      } elsif (join(" ", @word[1..2]) =~ /DATA DESCRIPTION/) {
181
	&section(0, "\\usage\{\ndata($fun)");
181
	&section(0, "\\usage\{\ndata($fun)");
182
	&section(0, "\\format\{");
182
	&section(0, "\\format\{");
183
      } else {
183
      } else {
184
	# This line may be of the form .SH "A B C"
184
	# This line may be of the form .SH "A B C"