-
Notifications
You must be signed in to change notification settings - Fork 4
add functions to build html reference manuals #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I will take a look at it tomorrow. I think the BBS has some Python functions that can wrap around R functions. |
While I can see that For Is I haven't looked too deeply but I did try to follow the examples, which worked for me. |
Hi Jen, @jwokaty I think copilot did a pretty good job at summarizing the code: The other functions in
End copilot.
This worked form me on a package tarball: > tools::pkg2HTML("AnVIL_1.19.3.tar.gz")
Warning message:
In y[i] <- if (is.null(value)) NULL else as.person(value) :
number of items to replace is not a multiple of replacement length
> file.exists("AnVIL.html")
[1] TRUE What are the advantages of running it on the tarball? I think running the code on the source package directory allows one to run it at any time (e.g., after the package is updated). The tarballs are dependent on the build process. It may also take more time to
I don't see where Yes, it is the first part of the full package URL, e.g., Best regards, |
The discussion last week helped clarify a lot of questions, including getting html from source versus tarballs. We'll get the HTML from source. I'll include the other clarifications/todos here:
I misspelled: it's called biocViews/vignettes/createReposHtml.Rmd Lines 33 to 34 in 8aa6daf
|
It would be less disruptive to generate from the source directories but may not be in sync with the builds. OTOH, generating from tarballs will be in sync with the builds but will have to be run after the tarballs are generated. Feel free to chime in Hervé @hpages.
Not necessarily. These files are for CRAN to inspect / merge into their DB for linking to Bioconductor cross-references.
By default, the
This will likely be another cell in the table on the landing page, right next to the pdf link.
I have changed |
Note. I've created a PR to update the landing pages with the HTML links: |
For the BBS builds the final repository structure is assembled close to the propagation step when it's easier to point to tarballs vs source repositories. I will work with whatever you make available. I misunderstood what you said about the 2 RDS files. Great, they don't need to be available for generating HTML. Just put them in the Meta directory. And we should use the defaults for |
@LiNk-NY I am looking at this again as I am thinking about how to incorporate with the BBS. Why do the resulting files from When I generated the HTML manuals, the links to other packages don't work in the current structure (for example, I'm on the SummarizedExperiment manual and click a link to GenomicRanges) because it expects a path like
|
Because the PDF manuals are in that location. And both the PDF and HTML pages should be in the same location:
Are you running the example code? It makes more sense to follow our own template than that of r-universe. The address bar was not recorded in the video but the pages are properly linked. |
@LiNk-NY I think it's easiest for me to wrap |
Yes, I meant
I may have loaded a "fixed" version of Note that this is relevant to the other aim of this change which is to update packages so that they all provide package anchors and link appropriately to the documentation. |
Can you link to the location of this code in the BBS repo? |
I don't understand what you mean by a 'fixed' version of SummerizedExperiment. Are you are saying my example is broken because there wasn't a well-formed package anchor there? I will try testing with lefser. If it's working as is, I will try to use it. Since I don't know if I can use that function, I tried to generate the HTML in the same place as the PDFs: https://github.com/Bioconductor/BBS/pull/438/files. There's another step that copies them into another place because files get moved a few times during the build. This is just the way that the BBS does it, not necessarily my preference. I am working on the other part to use your other functions with the BBS. |
A modified version of
Yes, I was also able to reproduce the broken link you were seeing.
No, we still have to update all the packages with missing package anchors. |
I just tested with lefser, which should have correct package anchors but links to other package from its manual are broken because the function needs a hook that alters the path. You can see from my PR how I am adding a hook and altering the link that's generated. Something like that would fix your function. |
Thanks for catching that. I added the custom |
I can confirm that links going out to other packages now work. Thank you. |
Will this code be used in BBS operations? Otherwise, it may not be worth maintaining in |
I will use |
I can modify the PR to remove |
@jwokaty |
AFAIK from to generate the HTML pages will require more work and input from a different R core member. Last time I worked on this, on the useR!2025, we were checking WCAG compliance and there were still some issues left. I think it is okay for now to merge the alias and rdxrefs function and start generating them. This alone has helped me identify issues on base R and many (CRAN) packages not complying with WRE regarding xrefs (and some other areas of improvements regarding help pages and xrefs). |
@LiNk-NY @llrs The first alias.rds and rdxrefs.rds files for 3.22 software packages are available. I noticed some packages were not included due to error that I need to investigate, but it would be great if someone could look at the assess if there are other issues? Also, are these just needed for software packages (not our annotation or experiment packages as well)? |
They are probably needed for workflow, annotation, and experiment data packages as well. There will likely be cross-references to documentation pages those type of packages. |
I checked the files and I noticed that some packages (a4, alabaster, alabaster.schemas, assorthead and biodbHmdb) don't have the three expected columns on the rdxrefs.rds file. Is there a reason behind this? Having a package without xrefs is possible, but inconsistencies on the formatting causes code to fail with error(s) and might indicate other problems in how is that file generated. bioc <- "https://bioconductor.org/packages/3.22/bioc/src/contrib/Meta/rdxrefs.rds"
raw_xrefs <- readRDS(url(bioc_xrefs_url))
ncols <- vapply(raw_xrefs, NCOL, numeric(1L))
names(ncols)[ncols < 3L] Other than that I'll explore the files more (for example for links to help pages only available on specific OS). Many thanks for providing them. One of the goals of having these files is to facilitate having HTML help pages for all packages on these CRAN and Bioconductor repositories with links that resolve correctly. Including the other repositories (BioCsoft, BioCann, BioCexp, BioCworkflows and BioCbooks) will make it easier linking help pages. I hope they might be faster to generate and don't tax the server much. |
Hi @llrs Thank you for looking at the xref and aliases files. Maybe a4, alabaster, etc. don't have all columns because they don't have manuals? I guess they don't have references as they are primarily libraries. I have set up annotations and experiments to also produce these xrefs and aliases files, but since we don't produce manuals for books and workflows. Maybe they'll do the same as a4, alabaster, etc? Note: We do have about 46 packages missing from this data due to the way they generate their manuals and I how I produce the xrefs and aliases files, which I've listed at Bioconductor/BBS#454. |
I don't think this is due to a lack of cross references: other packages have the three columns but no rows. This is what I would expect from books and workflows, but it's good to know that they aren't expected to have manuals. I missed the issue about those 46 packages. This is more concerning as they include some packages that are widely used. I will check if there are some references to them from CRAN's packages. But it is a surprise that the aliases file can't be generated. This might indicate a different issue than requiring packages installed to process the documentation. But if I discover anything I'll report back to the linked discussion. |
This is a work in progress. The functions are working but I am not sure how to make them run on the builders.
See here for the local setup step for testing:
https://github.com/r-devel/repos/blob/main/R/minibioc.R
cc: @jwokaty @hpages