yihui / Rd2roxygen

Convert Rd to roxygen documentation
https://yihui.org/Rd2roxygen
32 stars 14 forks source link

useDynLib issue #15

Closed yfyang86 closed 10 years ago

yfyang86 commented 10 years ago

I happened to find Rd2roxigen will delete useDynLib or other lines other than those have export in NAMESPACE file. It would be great if you could add useDynLib as a keyword when parsing NAMESPACE in reformat_code(). Although I don't think people need to reformat a NAMESPACE file indeed.

yihui commented 10 years ago

Are you using roxygen2 4.0 on CRAN? It seems that should not happen: https://github.com/yihui/Rd2roxygen/blob/e12333da68312ded3323831c50ba0bf31ac69004/R/build.R#L92-L93 I only remove the comment Generated by roxygen2, but it is possible that your NAMESPACE was not generated from roxygen2.

yfyang86 commented 10 years ago

Yes, I created a new package and used rab() to create doxygen docs, which deleted the useDynLib() directly. In this case, am I not supposed to use rab()? In fact, I am only looking for a way to generate doxygen files by parsing Rd file. Maybe I can parse them separately.

yihui commented 10 years ago

On second thought, I still do not think this could be a Rd2roxygen problem. Do you have a minimal reproducible example?

I have useDynLib in the markdown package: https://github.com/rstudio/markdown/blob/master/NAMESPACE and I do not see how it can disappear after I run rab(). Did you use #' @useDynLib in roxygen? e.g. https://github.com/rstudio/markdown/blob/e50404b0e3a28a2b285e67d84b11e19877aa7ade/R/markdown-package.R#L24