Skip to content

Best practices in developing package: From a single file

4 messages · Duncan Murdoch, Joris Meys, Hadley Wickham

#
On 31/01/2018 6:59 AM, Duncan Murdoch wrote:
[ lots deleted ]
I've taken a look at the Markdown support, and I think that is 
fantastic.  I'd rather it wasn't inline in the .R file (does it have to 
be?), but I'd say it tips the balance, and I'll certainly experiment 
with using that for new projects.

The only negative I see besides forcing inline docs is pretty minor:  I 
can see that supporting Rd markup within the Markdown text will on rare 
occasions cause lots of confusion (because users won't know why their 
backslashes are doing funny things).  I'd suggest that (at least 
optionally) you should escape anything that looks like Rd markup, so a 
user can put text like \item into the middle of a paragraph and not have 
the Rd parser see it.

Duncan Murdoch
#
On Thu, Feb 1, 2018 at 1:29 PM, Duncan Murdoch <murdoch.duncan at gmail.com>
wrote:
You don't have to put the Rmarkdown in the .R file of the function, there
are ways to keep them in separate files. But keeping them in the same file
does make it easier for Rmarkdown to eg generate the correct usage section
and use the correct Rd makeup etc. At least that's my understanding of it.
Hadley will hopefully correct me if I'm wrong.  I haven't checked all the
options and possibilities yet in the latest iterations of the package.

Cheers
Joris
#
On 01/02/2018 7:44 AM, Joris Meys wrote:
I don't see that in the Roxygen2 docs, so hopefully it is possible, and 
someone will point out how it's done.

Duncan Murdoch
#
On Thu, Feb 1, 2018 at 4:29 AM, Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
Please do let me know how it goes - often a fresh set of eyes reveals
problems that an experienced user is blind to.
Yes, that would certainly be nice. It's a little challenging because
we're using the commonmark parser, but it should be possible somehow.

Hadley