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

Bug: has_keyword() adds all instead of nothing if the keyword does not occur #2234

Closed
bundfussr opened this issue Nov 15, 2022 · 4 comments · Fixed by #2243
Closed

Bug: has_keyword() adds all instead of nothing if the keyword does not occur #2234

bundfussr opened this issue Nov 15, 2022 · 4 comments · Fixed by #2243
Labels
bug an unexpected problem or unintended behavior
Milestone

Comments

@bundfussr
Copy link

If a reference section is created using has_keyword() and the keyword does not occur, all functions are added to the section.
For example

- subtitle: BDS Derivations
  contents:
  - has_keyword("der_bds_gen")
  - has_keyword("der_bds_findings")

generates a section with all functions if the der_bds_gen keyword isn't used by any function. The issue occurs only if there is another entry in contents: which is not empty. I.e.,

- subtitle: BDS Derivations
  contents:
  - has_keyword("der_bds_gen")

creates an empty section as expected.

@jayhesselberth jayhesselberth added bug an unexpected problem or unintended behavior and removed bug an unexpected problem or unintended behavior labels Nov 19, 2022
@maelle
Copy link
Collaborator

maelle commented Nov 25, 2022

Thanks for reporting. Would you have time to create a minimal reproducible example, for instance a package with a few manual pages and this configuration? https://pkgdown.r-lib.org/CONTRIBUTING.html#package-reprexes This would save time on this end. No worries if not. 😸

@bundfussr
Copy link
Author

For a small example see https://github.com/bundfussr/mybugpkg. The function a_fun() is displayed in both sections of the reference page. If the line

  - has_keyword("der_bds_gen")

is removed from _pkgdown.yml, this does not happen.

@maelle maelle added the bug an unexpected problem or unintended behavior label Nov 29, 2022
@maelle
Copy link
Collaborator

maelle commented Nov 29, 2022

Thank you! I'll explore more later but can now easily reproduce the bug. 🚀 🙏

@maelle
Copy link
Collaborator

maelle commented Nov 29, 2022

draft PR #2243

@maelle maelle added this to the 2.0.7 milestone Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants