Generate html manuals in extractManuals - #17
Conversation
86caf47 to
2442031
Compare
|
Hi Andres, @jwokaty I reviewed the code and the proposed change. |
|
@LiNk-NY Thanks for looking at this. I realized that it doesn't work for all packages and it may not be used by the BBS anymore. Software manuals (data experiment and maybe some annotations too) are pulled from R.check folders, which is done during the BBS postrun so I am making changes there Bioconductor/BBS#438. I put this in WIP until I can assess if this is still being used. Maybe it's only used for the packages that aren't built by the BBS? |
There was a problem hiding this comment.
Pull request overview
Adds HTML reference manual generation to the existing extractManuals() pipeline so that, alongside the PDF built from extracted Rd files, an HTML manual is also produced under PKGNAME/man/PKGNAME.html in the manuals output tree.
Changes:
- Expand pre-extraction cleanup to remove prior
*.htmlmanuals alongside*.pdf/*.Rd. - Generate an HTML manual after running
R CMD Rd2pdf, writing it topkg/man/pkg.htmlviatools::pkg2HTML(). - Add a
pkg_hrefhook to generate relative cross-package links between manuals.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ## create html | ||
| hooks <- list(pkg_href = function(pkg) sprintf("../../%s/man/%s.html", pkg, pkg)) | ||
| tools::pkg2HTML(dir = pkgDir, out = paste0(pkgDir, "/", pkg, ".html"), | ||
| hooks = hooks) | ||
| cleanUnpackDir(tarball, unpackDir, "man", ".*\\.(Rd|rd)$") |
| ## create pdf | ||
| Rd2pdfCmd <- paste0( | ||
| RCmd, " CMD Rd2pdf --no-preview ", | ||
| "--output=", pkgDir, "/", pkg, ".pdf ", | ||
| "--title=", pkg, " ", pkgDir, "/*.[Rr]d") | ||
| ret <- system(Rd2pdfCmd) | ||
| ## create html | ||
| hooks <- list(pkg_href = function(pkg) sprintf("../../%s/man/%s.html", pkg, pkg)) | ||
| tools::pkg2HTML(dir = pkgDir, out = paste0(pkgDir, "/", pkg, ".html"), | ||
| hooks = hooks) |
May alternatively fulfill creating html manuals mentioned in #15. Creates html manual in the same function as the pdf manual and places it in the
pkg/man/pkg.htmlpath.Note: This doesn't seem to be the way that manuals are created anymore although there's some cruft in the BBS code pointing to it. Keeping for referencing temporarily.