pkgdown icon indicating copy to clipboard operation
pkgdown copied to clipboard

No `quiet` arg for `build_site`

Open givison opened this issue 2 years ago • 1 comments

I'm working on debugging an issue running build_site where a function is hanging but doesn't error. I was able to narrow it down to one of my pages and made further progress on debugging by running build_article with quiet = FALSE specifically for that page. But this would have been much more straightforward if build_site had a quiet argument itself.

givison avatar Aug 09 '23 14:08 givison

I think this would be a great opportunity for a community contribution. It's quite a bit of work, but I think the individual tests are reasonable simple:

  • Add a quiet argument to build_site()
  • Pass it through to build_site_external()/build_site_local()
  • In build_site_local() pass it through to each build_ function that already has a quiet argument
  • Add a snapshot test to make sure it actually works 😄
  • Document the new quiet parameter — this is slightly tricky because it doesn't actually quiet all output (since we want to keep the existing headers), but I don't think it's worth fixing this problem in the code.

hadley avatar Apr 17 '24 21:04 hadley

Is anyone working on this? It would be very helpful for debugging problems on github actions especially.

ethanbass avatar Jun 02 '25 19:06 ethanbass

I am not, and won't be able to get to it for a while. Happy to review a PR.

jayhesselberth avatar Jun 02 '25 20:06 jayhesselberth

OK. I'll see if I can find a little time to look into it.

ethanbass avatar Jun 02 '25 21:06 ethanbass

@ethanbass Took a quick stab at the above. Is there a specific output we should be testing for in the snapshot?

jayhesselberth avatar Jun 03 '25 22:06 jayhesselberth

Thanks for working on this! I think the section where it shows the actual output from the rendering of the vignette is the key piece, but I don't know if there's an easy way to test for this specific section? (This part is missing from the output of your test because of the issue i noted on https://github.com/r-lib/pkgdown/pull/2899). It also seems like the snapshot tests are failing because of small differences in the formatting of the console output across runners. Do you know if this has been an issue for other snapshot tests?

+                  \── Building articles ───────────────────────────────────────────────────────────            
                    +                  |Writing `articles/index.html`            
                    +                  /Reading vignettes/kitten.Rmd            
                    +                  -\|/            
                    +                              
                    +                  processing file: kitten.Rmd            
                    +                  -1/10                              
                    +                  \2/10 [unnamed-chunk-1]            
                    +                  |3/10                              
                    +                  4/10 [unnamed-chunk-2]            
                    +                  /5/10                              
                    +                  6/10 [unnamed-chunk-3]            
                    +                  -7/10                              
                    +                  8/10 [magick]                     
                    +                  \|9/10                              
                    +                  /10/10 [plot]                       
                    +                  -output file: /private/var/folders/63/yn9cxpy52tg1ywn5r6n514xc0000gn/T/Rtmpb8cilX/kitten.knit.md            

Edit: I just realized after writing this that this inconsistency across platforms is what the transform argument inexpect_snapshot is trying to rectify. I guess the current parameters are not sufficient though.

ethanbass avatar Jun 04 '25 01:06 ethanbass