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
Edit template #1319
Edit template #1319
Conversation
I recently added a feature to I suspect something similar might be useful here, because who is going to remember the exact names of their existing templates? So if |
Ooo that's a great idea, thank you! I'll try to add that today. I've greatly enjoyed that functionality for the pr functions so far for exactly the same reason |
Ok, PS I noticed that Hadley's change to the tests resulted in just calling |
Thanks! |
Awesome, thanks to you both! |
This PR adds
edit_template()
for creating and editing files ininst/templates
. I've resisted this PR because it's such a simple function, but I find myself constantly wanting to have it available. I'm conscious of the fact that, as the package matures, these little helper functions may not find their forever home in usethis. Nevertheless, here's why I think usethis should have this function:use_template()
introduces a structure, much in the way that R Markdown templates do. That structure should be automated away because if you misspecify it, templates will not work.use_rmarkdown_template()
is important not just because of the complexity of that structure but the consistency. usethis templates use a considerably simpler structure, yet--and I'm not kidding--I can never remember if it'sinst/template
orinst/templates
. I literally have to look it up every single time.