[R-pkg-devel] Single page reference manual in html format

Deepayan Sarkar deep@y@n@@@rk@r @end|ng |rom gm@||@com
Fri Apr 15 20:36:19 CEST 2022


On Fri, Apr 15, 2022 at 11:48 PM Duncan Murdoch
<murdoch.duncan using gmail.com> wrote:
>
> On 15/04/2022 1:16 p.m., Deepayan Sarkar wrote:
> > On Sat, Apr 9, 2022 at 8:35 PM Jeroen Ooms <jeroen using berkeley.edu> wrote:
> >>
> >> Is there a way to generate the package reference manual in a (one
> >> page) html format? It would be nice to access reference manuals from
> >> devices without a pdf reader.
> >
> > I don't think so, but it would certainly be a nice feature to have.
> >
> > Most of the necessary code is already there, so it shouldn't be too
> > difficult. We'll work on it.
>
> I think this would be better done in a contributed package rather than
> in core R, because there are lots of customizations that people would want:
>
> - Some people would want to execute the example code, like pkgdown does.
> - Some people would want each help page in a separate HTML page (like
> pkgdown), but with links to step through all the pages (I don't think
> pkgdown does this).
> - People would want to customize the look of the page, possibly with
> syntax highlighting, or just different fonts and layouts.
>
> Adding an "all in one page" option to pkgdown might be the easiest way
> to do this, because they already have a lot of customization
> possibilities.  But there are probably other "make a web page for this
> package" packages out there.

Yes, that might be a good alternative.

> If you do include it in base R, please at least allow the CSS to be
> customized.

Sure. So far I was only thinking of adding a couple of arguments to Rd2HTML()

- 'standalone=TRUE' (FALSE would skip the header and footer), and possibly

- 'Rhtml=FALSE' (TRUE would wrap the examples inside <!--begin.rcode
and end.rcode-->

This should make it easier to build up whatever is desired, regardless
of what base R implements. HTMLheader() already has an option to
specify the CSS file, so that could be used to create the header.

Best,
-Deepayan

> Duncan Murdoch



More information about the R-package-devel mailing list