Links between help pages and vignettes
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- r
- Domain
- documentation
Research direction
Review pkgdown.yaml and the Rd and vignette processing paths to determine where link paths can be defined for each output context. Compare the proposed VignetteRdPath and RdVignettePath behavior with the existing rgl macros.Rd example. Done means pkgdown consistently defines or applies the paths so generated HTML links work between help pages and vignettes.
Written by the indexing model from the issue text.
Description
Summary: I suggest adding two environment variables to facilitate links between help pages and vignettes.
Background:
I'm currently revising documentation in rgl, and want to improve the links from vignettes to help pages and from help pages to vignettes, all in HTML format.
The big problem here is that the directories holding the .html files have different names in different contexts. R dynamic help puts help files in ../<pkg>/html and vignettes in ../<pkg>/doc, while pkgdown puts help files in ../<pkg>[/dev]/reference and vignettes in ../<pkg>[/dev]/articles. CRAN puts vignettes in ../<pkg>/vignettes. (I don't think CRAN currently hosts the help pages in HTML format, but they're thinking about it. All help pages are in the big PDF reference manual.)
My current attempt at a solution uses a function in vignettes and a user macro in help files to construct the link, and uses environment variables to tell them what names to use. You can see the latest version of the macro here:
https://github.com/dmurdoch/rgl/blob/master/man/macros/macros.Rd
The two environment variables I've used are
- VignetteRdPath: The path to HTML versions of Rd files as seen from a vignette.
- RdVignettePath: The path to vignettes as seen from an HTML help file.
For pkgdown, I use these definitions in my pkgdown.yaml Github action:
RdVignettePath: ../articles/
VignetteRdPath: ../reference/
Then in a vignette, the help file for plot3d would be expanded to ../reference/plot3d.html, and in a help page the rgl vignette link would expand to ../articles/rgl.html.
A more general scheme would use sprintf() fmt strings instead of prefixes to the HTML filename. [EDIT HERE]: I tried that and then switched to this simpler scheme because I suspected a bug somewhere, but I haven't been able to reproduce it today. But in any case, I don't know of examples that need sprintf().
So my suggestion is that pkgdown should define these environment variable definitions into the pkgdown.yaml action or into the Rd and vignette processing code, and then other packages could automatically make use of this scheme. I'm happy to discuss other names or other ways to specify these paths.
- Dominant language
- R
- Stars
- 775
- Forks
- 355
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from r-lib/pkgdown
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
r-lib/pkgdepends#485 · 3 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
beginners blocker
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enviPathR OpenBuild Error Build OK Build Warning policies-accepted pre-review precheck-passed
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Bioconductor/BiocContributions#207 · 6 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
datacarpentry/semester-biology#1255 ·