mlysy / rdoxygen

Create doxygen documentation for R package C++ code
GNU General Public License v2.0
17 stars 2 forks source link

Generate from header in inst/include? #9

Open thk686 opened 4 years ago

thk686 commented 4 years ago

I have packages that export C++ header files located in inst/include. Can I use this package to document them?

kellijohnson-NOAA commented 1 month ago

I have the same question and I am also wondering if this package is planning on continuing to be maintained as the last release was quite some time ago. Thanks 🙏

mlysy commented 1 month ago

First of all, delighted to hear that rdoxygen might be useful to you!

I have packages that export C++ header files located in inst/include. Can I use this package to document them?

tl;dr

Yes, as long as you aren't trying to create doxygen vignettes. In other words, you can run rdoxygen::doxy(vignettes = FALSE) and it will create the doxygen documentation for you -- minus the vignettes.


No doxygen vignettes?

The integration of doxygen documentation into the R vignette system is what stalled this project many years ago. Specifically, we originally tried to inject the doxygen html output into an R vignette via inst/doc (details here). However, devtools (which pretty much everyone uses for package development) deletes the inst/doc folder when you run e..g, devtools::build_vignettes(). After a long discussion about this with the devtools team, we came to the conclusion that even if we managed to inject doxygen html input into an R vignette, that would add considerable size to the package and CRAN would probably complain if you tried to host it there.

Some alternatives are:

Ultimately we didn't pursue this last approach further because (i) we were hoping to avoid the moxygen dependency (though maybe it's not that big a deal after all) and (ii) the vignette output was a bit ugly / difficult to navigate and there wasn't much support to work on this aspect in our day jobs. However, if you're interested in picking up the doxygen vignette problem I would be more than happy to discuss a PR :)

mlysy commented 1 month ago

Hmm even without vignettes you'll probably want to add inst/doxygen to .Rbuildignore before submitting to CRAN...

kellijohnson-NOAA commented 1 month ago

Thank you for all of the info, I will explore using {rdoxygen} as is and then potentially discuss future PR if we get that far. Thanks again 😃!