Skip to content

Generate html manuals in extractManuals - #17

Draft
jwokaty wants to merge 1 commit into
develfrom
extractManuals-with-html
Draft

Generate html manuals in extractManuals#17
jwokaty wants to merge 1 commit into
develfrom
extractManuals-with-html

Conversation

@jwokaty

@jwokaty jwokaty commented Feb 4, 2025

Copy link
Copy Markdown
Contributor

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.html path.

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.

@jwokaty jwokaty self-assigned this Feb 4, 2025
@jwokaty
jwokaty force-pushed the extractManuals-with-html branch from 86caf47 to 2442031 Compare February 4, 2025 14:30
@jwokaty
jwokaty marked this pull request as draft February 5, 2025 15:14
@LiNk-NY

LiNk-NY commented Feb 6, 2025

Copy link
Copy Markdown
Contributor

Hi Andres, @jwokaty

I reviewed the code and the proposed change.
The code written here only works for data/annotation packages which should come shipped with PDF manuals (as we don't build them with the BBS).
Perhaps Lori @lshep can provide more context but the current proposed changes in this PR would only affect annotation packages and not all the software packages as intended.

@jwokaty

jwokaty commented Feb 6, 2025

Copy link
Copy Markdown
Contributor Author

@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?

@jwokaty
jwokaty marked this pull request as ready for review February 10, 2025 18:21
@jwokaty
jwokaty marked this pull request as draft May 1, 2025 12:29
@jwokaty
jwokaty marked this pull request as draft May 1, 2025 12:29
@jwokaty
jwokaty marked this pull request as draft May 1, 2025 12:29
@jwokaty
jwokaty marked this pull request as draft May 1, 2025 12:29
@jwokaty
jwokaty marked this pull request as draft May 1, 2025 12:29
@LiNk-NY
LiNk-NY requested a review from Copilot July 28, 2026 15:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 *.html manuals alongside *.pdf/*.Rd.
  • Generate an HTML manual after running R CMD Rd2pdf, writing it to pkg/man/pkg.html via tools::pkg2HTML().
  • Add a pkg_href hook to generate relative cross-package links between manuals.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread R/repository.R
Comment on lines +96 to 100
## 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)$")
Comment thread R/repository.R
Comment on lines +90 to +99
## 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants