Re: [Rd] R CMD Rdconv drops sections: arguments, seealso, examples (PR#9645)

From: Bill Dunlap <bill_at_insightful.com>
Date: Tue, 01 May 2007 10:45:31 -0700 (PDT)

On Mon, 30 Apr 2007 bill_at_insightful.com wrote:

> On Tue, 10 Apr 2007 timh@insightful.com wrote:
>
> > I've created a .Rd file (below), then converted that to .sgml using
> > R CMD Rdconv --type=Ssgm combn.Rd > combn.sgml
> > The output (shown below) is missing some of the sections:
> > arguments
> > seealso
> > examples
> > If instead I convert to .d (below), the same sections are missing,
> > and the "note" section is included but without the necessary newline.
>
> The underlying problem was that there were some unmatched open-braces.
> (or 'brackets'?) The attached patch to share/perl/R/Rdconv.pm:mark_brackets()
> seems to detect unmatched open and close braces and throw an error:
>
> % R CMD INSTALL -l /tmp/Rlib timhPackage
> * Installing *source* package 'timhPackage' ...
> ** help
> >>> Building/Updating help pages for package 'timhPackage'
> Formats: text html latex example
> Rdconv(): mismatched braces in help file timh.Rd on or after line 12
> ERROR: building help failed for package 'timhPackage'
> ** Removing '/tmp/Rlib/timhPackage'
> ** Restoring previous '/tmp/Rlib/timhPackage'
>
> The code to report the line number doesn't work quite right
> since any "% comment" lines in the Rd file have been removed
> from $complete_text by the time we get here. I fudged by
> putting 'on or after line XXX' in the error message.

The following patch adds a little more information (the name of the \tag or whether it is an unmatched { or }) to the error message, so Tim's example results in

    % R CMD INSTALL -l /tmp/Rlib timhPackage

  sub unmark_brackets {



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Tue 01 May 2007 - 17:48:11 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 01 May 2007 - 19:33:14 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.