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

[Docs] Update ggplot2_args roxygen2 template or integrate with shared_params #695

Open
averissimo opened this issue Feb 27, 2024 · 3 comments · Fixed by #694
Open

[Docs] Update ggplot2_args roxygen2 template or integrate with shared_params #695

averissimo opened this issue Feb 27, 2024 · 3 comments · Fixed by #694
Labels
bug Something isn't working core

Comments

@averissimo
Copy link
Contributor

@kartikeyakirar found an interesting thing on the documentation about the @template tag

Q: Should we keep using the @template tag? (it has been superseded)
take a look at man-roxygen/ggplot2_args_multi.R and search for ggplot_2_args_multi

If we stop using it, we can add this parameter to the shared_params definition and add the custom information to @details

Context

{tmg} is using the @template roxygen tag to add a "customizable" parameter ggplot2_args.

This template allows a special <%=ggnames%> string that defines a placeholder for a ggnames variable and, thus, has a custom documentation for each time it's used. (to supply different allowable values)

This tag has been superseded by {roxygen2} in favour of inline code.

Definition of Done

  • ggplot2_args roxygen @template needs updating along with rest of documentation
  • Move file under man/roxygen/template
    • Or integrate with shared_params & add specific context to individual man pages.
@averissimo averissimo added bug Something isn't working core labels Feb 27, 2024
@averissimo
Copy link
Contributor Author

I don't see an immediate need to remove this tag as long as it's not deprecated. It seems useful and removes duplicated code.

@averissimo averissimo changed the title Update ggplot2_args roxygen2 template or integrate with shared_params [Docs] Update ggplot2_args roxygen2 template or integrate with shared_params Feb 27, 2024
@averissimo averissimo linked a pull request Feb 27, 2024 that will close this issue
@gogonzo
Copy link
Contributor

gogonzo commented Feb 28, 2024

If we stop using it, we can add this parameter to the shared_params definition and add the custom information to @details

Do you think we can move it to shared_params with a dynamic list of ggnames somehow? When it is in shared_params then it is constant for all inheriting documents.
Do you mean that some content can be share in shared_params and some can be separately included in each @details

averissimo added a commit that referenced this issue Feb 28, 2024
# Pull Request

<!--- Replace `#nnn` with your issue link for reference. -->

- Closes #695
- Part of #624

#### Changes description

- Update type in `ggplot2_args`
- Minor change to phrasing
- Move template file under `man` page to avoid extra folder at root
level ([available
since](https://roxygen2.r-lib.org/news/index.html?q=template#options-7-0-0)
`[email protected]`)
- Update `.Rbuildignore` accordingly

#### Reviewer should consider

- `@template` has been superseded
(https://roxygen2.r-lib.org/articles/reuse.html?q=template#superseded)
  - There's no equivalent though _(with parameterized strings)_
- Alternative: we could add `ggplot2_args` to `shared_params` and
specific list of names it can take in `@details` on each function that
uses this
@averissimo
Copy link
Contributor Author

Do you think we can move it to shared_params with a dynamic list of ggnames somehow?

AFAIK from reading the documentation it's not possible, but if it is, then that would be the best solution

Do you mean that some content can be shared in shared_params and some can be separately included in each @details

Yes, either in the details or in a separate section.

#' inheritParams shared_params
#' ...
#' @details
#' #### `ggplot2_args`
#' List names for `ggplot2_args` should match the following: `c("default", "A", "B", "C")`.
#'
#' For more details see the vignette: `vignette("custom-ggplot2-arguments", package = "teal.widgets")`.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants