Skip to content

0.1.252

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 02 Jul 19:32
670a494
Set R >=4.6.0's `help.htmltoc`option to `FALSE` (#1307)

Addresses https://github.com/posit-dev/positron/issues/12840

Relevant R commits:
-
https://github.com/wch/r-source/commit/2022aa9cd39e7fa2bbea87c33a96c0282952b1c7
-
https://github.com/wch/r-source/commit/3484008e6ea7d94ef882bbfebb07b48e52602e82

R 4.6.0 added a new `help.htmltoc` global option. The point of this was
to help add a TOC on the left hand side of CRAN's new HTML page for R
package docs:
https://cran.r-project.org/web/packages/vctrs/refman/vctrs.html

It's on for "dynamic help", i.e. when you go through `httpd()` which
calls `Rd2HTML(dynamic = TRUE, toc = getOption("help.htmltoc", TRUE))`,
and we of course use `httpd()` for installed package help.

(Notably its not broken for "preview" R package help, i.e. for
development version docs, since we control the `Rd2HTML()` call there
and don't supply `toc`, see `.ps.Rd2HTML()`).

---

We have two options:

- Turn it off using the only hook we have, the `help.htmltoc` global
option
- Try to use it, by adapting to the new `R-nav.css` stylesheet, which
weirdly feels like `R.css` with some extra additions?
https://github.com/wch/r-source/blob/d5e28ead42751bc5a46bef44b3f351642c4d60d3/doc/html/R-nav.css#L2-L6

I think trying to use `R-nav.css` is probably a mistake, the TOC won't
get us much, and is supposed to be hidden on narrow screens anyways.
Since the Help pane is usually narrow, it would pretty much always be
hidden.

So instead the best option is to just turn it off on load.

---

I have confirmed locally that this fixes the mangled help issue.