-
Notifications
You must be signed in to change notification settings - Fork 25
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
Use inline R code for badges #17
Comments
It's only needed for deprecated functions really. You might want to wait before we publish the blog post though, there are last minute UI discussions going on ;). Also we'll change some of the badge colours. |
Sratch that, |
Thanks for explaining, @lionel-. The badges show up correctly when I copy the output of |
Hmm... maybe not. The code creates long lines, so the macros are actually really handy. |
I think if you just copy badge.R in your package, and make the macro call |
Sounds reasonable, thanks. I will go with that. |
In the next version of roxygen you'll be able to do : #' `r lifecycle::badge("deprecated")` That will run |
@lionel- When you do this, will you also determine if https://github.com/r-lib/usethis/blob/9b462b1918bb1e089d3160724131dfa6746fb1fa/R/lifecycle.R#L21 |
For updating existing code with GNU sed: sed -r -i 's/\\lifecycle[{](.*)[}]/`r lifecycle::badge("\1")`/' R/* |
Thanks Kirill! This variant may also be useful with the old lifecycle compat files: gsed -r -i 's/\\Sexpr\[results=rd, stage=render\][{]rlang:::lifecycle\((.*)\)[}]/`r lifecycle::badge(\1)`/' R/* |
Looks like we'll need r-lib/roxygen2#1115 solved first. |
The great thing about develop-time dependencies: you can install locally from a branch 🙃 |
Would you help me understand why
usethis::use_lifecycle()
addslifecycle
to Imports rather than Suggests?I am new to
lifecycle
, and I am happy to see that tidyverse lifecycle badges have become more widely available.The text was updated successfully, but these errors were encountered: