Skip to content
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

Add advice to use usethis::edit_pkgdown_config() #2419

Merged
merged 7 commits into from
Apr 2, 2024
Merged

Conversation

olivroy
Copy link
Collaborator

@olivroy olivroy commented Mar 15, 2024

If pkg is not available within the functions

Added a couple of call to improve error messages as I saw them. Sorry the PR is not very focused. Sometimes it is hard to come back to it later...

Also the many changes in snapshots are caused by the fact that {.file } quotes in non-interactive, while cli::style_hyperlink() doesn't.

Addresses #2329

use pkgdown_config_href() when pkg is available.

Recommend usethis::edit_pkgdown_config() otherwise.
expect_snapshot(build_favicons(pkg)),
"Can't find package logo"
expect_snapshot(error = TRUE,
expect_output(build_favicons(pkg), "Building favicons")
Copy link
Collaborator Author

@olivroy olivroy Mar 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reasons, cli_alert_*() are not shown in snapshot tests, hence the expect_output() here to capture the desired behavior. As you can see in the previous snapshot, there was nothing. #2470

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm. We should probably switch those to cli_inform(), just for consistency, but that can be a separate PR.

expect_snapshot(build_favicons(pkg)),
"Can't find package logo"
expect_snapshot(error = TRUE,
expect_output(build_favicons(pkg), "Building favicons")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm. We should probably switch those to cli_inform(), just for consistency, but that can be a separate PR.

@hadley hadley merged commit 9b928b2 into r-lib:main Apr 2, 2024
13 checks passed
@hadley
Copy link
Member

hadley commented Apr 2, 2024

Thanks!

@olivroy olivroy deleted the advice branch April 10, 2024 10:55
SebKrantz pushed a commit to SebKrantz/pkgdown that referenced this pull request Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants