The R Project SVN R

Rev

Rev 7002 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7002 Rev 7133
Line 460... Line 460...
460
 
460
 
461
    if($_[0]!= -1) {
461
    if($_[0]!= -1) {
462
      if($_[0]) { open htmlout, "> $_[0]"; } else { open htmlout, "| cat"; }
462
      if($_[0]) { open htmlout, "> $_[0]"; } else { open htmlout, "| cat"; }
463
    }
463
    }
464
    $using_chm = 0;
464
    $using_chm = 0;
465
    print htmlout html_functionhead($blocks{"title"}, $pkgname,
465
    print htmlout html_functionhead(striptitle($blocks{"title"}), $pkgname,
466
				    $blocks{"name"});
466
				    $blocks{"name"});
467
 
467
 
468
    html_print_block("description", "Description");
468
    html_print_block("description", "Description");
469
    html_print_codeblock("usage", "Usage");
469
    html_print_codeblock("usage", "Usage");
470
    html_print_argblock("arguments", "Arguments");
470
    html_print_argblock("arguments", "Arguments");
Line 621... Line 621...
621
	## fix conversions in key of htmlindex:
621
	## fix conversions in key of htmlindex:
622
	my $argkey = $arg;
622
	my $argkey = $arg;
623
	$argkey =~ s/&lt;/</go;
623
	$argkey =~ s/&lt;/</go;
624
	$argkey =~ s/&gt;/>/go;
624
	$argkey =~ s/&gt;/>/go;
625
	$htmlfile = $htmlindex{$argkey};
625
	$htmlfile = $htmlindex{$argkey};
626
	
626
 
627
	if($htmlfile){
627
	if($htmlfile){
628
	    if($using_chm) {
628
	    if($using_chm) {
629
		if ($htmlfile =~ s+^$pkg/html/++) {
629
		if ($htmlfile =~ s+^$pkg/html/++) {
630
		    # in the same file
630
		    # in the same file
631
		} else {
631
		} else {
Line 820... Line 820...
820
    print nroffout ".ND\n";
820
    print nroffout ".ND\n";
821
    print nroffout ".pl 100i\n";
821
    print nroffout ".pl 100i\n";
822
    print nroffout ".po 3\n";
822
    print nroffout ".po 3\n";
823
    print nroffout ".na\n";
823
    print nroffout ".na\n";
824
    print nroffout ".tl '", $blocks{"name"},
824
    print nroffout ".tl '", $blocks{"name"},
825
          "($pkgname)''R Documentation'\n\n" if $pkgname;
825
          " {$pkgname}''R Documentation'\n\n" if $pkgname;
826
    print nroffout ".SH\n";
826
    print nroffout ".SH\n";
827
    print nroffout $blocks{"title"}, "\n";
827
    print nroffout striptitle($blocks{"title"}), "\n";
828
    nroff_print_block("description", "Description");
828
    nroff_print_block("description", "Description");
829
    nroff_print_codeblock("usage", "Usage");
829
    nroff_print_codeblock("usage", "Usage");
830
    nroff_print_argblock("arguments", "Arguments");
830
    nroff_print_argblock("arguments", "Arguments");
831
    nroff_print_block("format", "Format");
831
    nroff_print_block("format", "Format");
832
    nroff_print_block("details", "Details");
832
    nroff_print_block("details", "Details");
Line 889... Line 889...
889
    $text =~ s/\\beta/beta/go;
889
    $text =~ s/\\beta/beta/go;
890
    $text =~ s/\\epsilon/epsilon/go;
890
    $text =~ s/\\epsilon/epsilon/go;
891
    $text =~ s/\\left\(/\(/go;
891
    $text =~ s/\\left\(/\(/go;
892
    $text =~ s/\\right\)/\)/go;
892
    $text =~ s/\\right\)/\)/go;
893
    $text =~ s/\\R/R/go;
893
    $text =~ s/\\R/R/go;
-
 
894
# these are troff, not nroff
894
    $text =~ s/---/\\(em/go;
895
#    $text =~ s/---/\\(em/go;
895
    $text =~ s/--/\\(en/go;
896
#    $text =~ s/--/\\(en/go;
-
 
897
    $text =~ s/---/--/go;
-
 
898
    $text =~ s/--/-/go;
896
    $text =~ s/$EOB/\{/go;
899
    $text =~ s/$EOB/\{/go;
897
    $text =~ s/$ECB/\}/go;
900
    $text =~ s/$ECB/\}/go;
898
 
901
 
899
    $text = undefine_command($text, "link");
902
    $text = undefine_command($text, "link");
900
    $text = undefine_command($text, "emph");
903
    $text = undefine_command($text, "emph");
Line 1282... Line 1285...
1282
#==********************* Example ***********************************
1285
#==********************* Example ***********************************
1283
 
1286
 
1284
 
1287
 
1285
sub rdoc2ex { # (filename)
1288
sub rdoc2ex { # (filename)
1286
 
1289
 
1287
    local($tit = $blocks{"title"});
1290
    local($tit = striptitle($blocks{"title"}));
1288
 
1291
 
1289
    if(defined $blocks{"examples"}) {
1292
    if(defined $blocks{"examples"}) {
1290
	if($_[0]!= -1) {
1293
	if($_[0]!= -1) {
1291
	    if($_[0]) { open Exout, "> $_[0]"; } else { open Exout, "| cat"; }
1294
	    if($_[0]) { open Exout, "> $_[0]"; } else { open Exout, "| cat"; }
1292
	}
1295
	}
Line 1419... Line 1422...
1419
 
1422
 
1420
    $text =~ s/\\eeeeqn/\\eqn/go;
1423
    $text =~ s/\\eeeeqn/\\eqn/go;
1421
    $text =~ s/\\dddeqn/\\deqn/og;
1424
    $text =~ s/\\dddeqn/\\deqn/og;
1422
 
1425
 
1423
    $text =~ s/&/\\&/go;
1426
    $text =~ s/&/\\&/go;
1424
    $text =~ s/\\R /\\R\\ /go;
1427
    $text =~ s/\\R /\\R\{\} /go;
1425
    $text =~ s/\\\\/\\bsl{}/go;
1428
    $text =~ s/\\\\/\\bsl{}/go;
1426
    $text =~ s/\\cr/\\\\\{\}/go;
1429
    $text =~ s/\\cr/\\\\\{\}/go;
1427
    $text =~ s/\\tab(\s+)/&$1/go;
1430
    $text =~ s/\\tab(\s+)/&$1/go;
1428
 
1431
 
1429
    ##-- We should escape $LATEX_SPEC  unless within `eqn' above ...
1432
    ##-- We should escape $LATEX_SPEC  unless within `eqn' above ...
Line 1566... Line 1569...
1566
    if($code =~ /[$LATEX_SPECIAL]/){
1569
    if($code =~ /[$LATEX_SPECIAL]/){
1567
	warn("\nERROR: found `\@' in \\code{...\}\n")
1570
	warn("\nERROR: found `\@' in \\code{...\}\n")
1568
	  if $code =~ /@/;
1571
	  if $code =~ /@/;
1569
	warn("\nERROR: found `HYPERLINK(' in \$code: '" . $code ."'\n")
1572
	warn("\nERROR: found `HYPERLINK(' in \$code: '" . $code ."'\n")
1570
	  if $code =~ /HYPERLINK\(/;
1573
	  if $code =~ /HYPERLINK\(/;
1571
	## till 0.63.1 
1574
	## till 0.63.1
1572
	## $code = "\\verb@" . $code . "@";
1575
	## $code = "\\verb@" . $code . "@";
1573
	##          [Problem: Fails in new Methods.Rd: verb NOT in command arg!
1576
	##          [Problem: Fails in new Methods.Rd: verb NOT in command arg!
1574
	$code =~ s/[$LATEX_SPECIAL]/\\$&/go;# escape them (not the "bsl" )
1577
	$code =~ s/[$LATEX_SPECIAL]/\\$&/go;# escape them (not the "bsl" )
1575
	$code =~s/\\\^/\$\\,\\hat{\\,}\$/go;# ^ is SPECIAL
1578
	$code =~s/\\\^/\$\\,\\hat{\\,}\$/go;# ^ is SPECIAL
1576
	$code =~ s/\\~/\$\\,\\tilde{\\,}\$/go;
1579
	$code =~ s/\\~/\$\\,\\tilde{\\,}\$/go;
Line 1621... Line 1624...
1621
 
1624
 
1622
    if($_[0]!= -1) {
1625
    if($_[0]!= -1) {
1623
      if($_[0]) { open htmlout, "> $_[0]"; } else { open htmlout, "| cat"; }
1626
      if($_[0]) { open htmlout, "> $_[0]"; } else { open htmlout, "| cat"; }
1624
    }
1627
    }
1625
    $using_chm = 1;
1628
    $using_chm = 1;
1626
    print htmlout chm_functionhead($blocks{"title"}, $pkgname,
1629
    print htmlout chm_functionhead(striptitle($blocks{"title"}), $pkgname,
1627
				   $blocks{"name"});
1630
				   $blocks{"name"});
1628
 
1631
 
-
 
1632
    html_print_block("description", "Description");
1629
    html_print_codeblock("usage", "Usage");
1633
    html_print_codeblock("usage", "Usage");
1630
    html_print_argblock("arguments", "Arguments");
1634
    html_print_argblock("arguments", "Arguments");
1631
    html_print_block("format", "Format");
1635
    html_print_block("format", "Format");
1632
    html_print_block("description", "Description");
-
 
1633
    html_print_block("details", "Details");
1636
    html_print_block("details", "Details");
1634
    html_print_argblock("value", "Value");
1637
    html_print_argblock("value", "Value");
1635
 
1638
 
1636
    html_print_sections();
1639
    html_print_sections();
1637
 
1640
 
Line 1645... Line 1648...
1645
    print htmlout html_functionfoot();
1648
    print htmlout html_functionfoot();
1646
    close htmlout;
1649
    close htmlout;
1647
    $using_chm = 0;
1650
    $using_chm = 0;
1648
}
1651
}
1649
 
1652
 
-
 
1653
sub striptitle { # text
-
 
1654
    my $text = $_[0];
-
 
1655
    $text =~ s/\\//go;
-
 
1656
    $text =~ s/---/-/go;
-
 
1657
    $text =~ s/--/-/go;
-
 
1658
    return $text;
-
 
1659
}
-
 
1660
 
1650
# Local variables: **
1661
# Local variables: **
1651
# perl-indent-level: 4 **
1662
# perl-indent-level: 4 **
1652
# cperl-indent-level: 4 **
1663
# cperl-indent-level: 4 **
1653
# page-delimiter: "^#==" **
1664
# page-delimiter: "^#==" **
1654
# End: **
1665
# End: **