altdoc icon indicating copy to clipboard operation
altdoc copied to clipboard

Add support for images in `/man/figures`

Open tony-aw opened this issue 10 months ago • 12 comments

Hi

I tried to create a quarto website of a package (I completely removed the vignettes folder for testing purposes).

I get the following error:

── Update HTML ─────────────────────────────────────────────────────────────────────────────
ERROR: Project _quarto.yml validation failed.

In file D:\D Desktop\Publications\R package squarebrackets\squarebrackets\_quarto\_quarto.yml
(line 6, columns 3--13) property name code-links is invalid
5:   title: squarebrackets
6:   code-links: true
    ~~~~~~~~~~~
7:   navbar:
i The error happened in location website:code-links.

quarto and altdoc, as well as their dependencies, are up-to-date. And roxygen2, knitr, devtools, pkgdown, are also all up-to-date.

Kind regards,

Tony

tony-aw avatar Feb 25 '25 19:02 tony-aw

Hi, I've never used code-links but from what I can see in the docs they don't accept the value true? Do you have a small example or a link to a repo where this happens?

etiennebacher avatar Feb 25 '25 19:02 etiennebacher

Hi,

I've not published the repo with altdoc yet, because I wanted to try altdoc on my laptop first. altdoc creates the _quarto.yml file, I didn't create it, and I didn't touch the values that altdoc specifies. I see it's specified in altdoc here: https://github.com/etiennebacher/altdoc/blob/b1ff5b4886d370d8465b868049f20c4f8004d4d2/inst/quarto_website/quarto_website.yml#L11

Kind regards,

Tony

tony-aw avatar Feb 25 '25 19:02 tony-aw

I cannot reproduce on one of my packages that doesn't use altdoc. I used the devel version of altdoc and quarto 1.6.40.

Can you report the versions of altdoc and quarto that you use?

etiennebacher avatar Feb 25 '25 20:02 etiennebacher

altdoc version 0.5.0 quarto version 1.4.4

tony-aw avatar Feb 25 '25 21:02 tony-aw

Can you update quarto and see if that works? I mean the CLI tool, not the R package "quarto"

https://quarto.org/docs/get-started/

etiennebacher avatar Feb 25 '25 21:02 etiennebacher

Hi,

Yes! that was the issue. The Quarto program was not up-tp-date. The website now works without errors. Thanks for the help!

I did notice a different issue: altdoc is not rendering figures from function help pages. altdoc points figures to the folder /docs/help/figures/, but that folder is never created by altdoc. The figures in the package are stored in /man/figures/ (as is usally the case for R packages. Did I forget some kind of configuration?

Kind regards,

Tony

tony-aw avatar Feb 26 '25 19:02 tony-aw

By the way, simply copy-paste-ing the images from _quarto\man\figures to docs\help\figures fixes the issue of missing images. I could write a simple R script to do it for me everytime I update the website. But it might be more user-friendly if altdoc does this as part of the render_docs() function.

tony-aw avatar Feb 26 '25 19:02 tony-aw

But it might be more user-friendly if altdoc does this as part of the render_docs() function.

I agree but I can't promise I'll work on this anytime soon. It might be better to use a custom script for this for now.

Just for future me, I think this is the same as https://github.com/etiennebacher/altdoc/issues/7

etiennebacher avatar Feb 26 '25 21:02 etiennebacher

@tony-aw the automatic copy to docs/help/figures should now be handled by altdoc (dev version). It would be great if you could confirm that with your own package.

etiennebacher avatar Apr 08 '25 12:04 etiennebacher

I'm using the development version and I still have this error, more specifically

I did notice a different issue: altdoc is not rendering figures from function help pages.
altdoc points figures to the folder /docs/help/figures/, but that folder is never created by altdoc. The figures in the package are stored in /man/figures/ (as is usally the case for R packages.
Did I forget some kind of configuration?

Kind regards,

From the notes it looks like #321 should have addressed but I'm seeing the same issue.

usrbinr avatar Oct 27 '25 01:10 usrbinr

Do you have a repo where you have this issue and that I could use to reproduce the problem?

etiennebacher avatar Oct 28 '25 08:10 etiennebacher

Do you have a repo where you have this issue and that I could use to reproduce the problem?

https://github.com/usrbinr/contoso

 packageVersion("altdoc")

‘0.6.0.9000’

packageVersion("quarto")
 ‘1.5.1’

quarto -v
1.8.25

```

usrbinr avatar Oct 29 '25 00:10 usrbinr