Skip to content

Support for .Rnw files #431

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

Closed
Hasnep opened this issue Oct 11, 2018 · 6 comments
Closed

Support for .Rnw files #431

Hasnep opened this issue Oct 11, 2018 · 6 comments

Comments

@Hasnep
Copy link

Hasnep commented Oct 11, 2018

Sorry if this is a dumb thing to ask, but are there any plans to add support for .Rnw files?

If not, how difficult would it be for me to add this as someone who is unfamiliar with developing R libraries?

@lorenzwalthert
Copy link
Collaborator

lorenzwalthert commented Oct 11, 2018

Sorry if this is a dumb thing to ask, but are there any plans to add support for .Rnw files?

It's not 😄. I indeed thought about it some time ago, but since I am not using .Rnw myself, I decided not to look into it. To be honest I am not sure how easy that is for you. @jonmcalder and I implemented the .Rmd feature in #233. I think it should not be too hard to adapt the package to handle .Rnw too since from what I can tell, it looks as if we mainly have to change the regex that is dedicated to match {r now. But if you are not familiar with R package development workflows, even a small change in the source code can be tricky. @jonmcalder would you be interested in extending styler in that direction?

@jonmcalder
Copy link
Contributor

Sure - this seems feasible and I'd be happy to assist with this. @Hasnep if you'd like to work on this together let me know and we can chat further?

@lorenzwalthert
Copy link
Collaborator

Cool Jon. Thanks for taking care of this. Looking forward to review a PR 😊

@Hasnep
Copy link
Author

Hasnep commented Oct 13, 2018

Thank you both for your quick responses. I don't think my R skills are at the level where I can usefully contribute yet.

@lorenzwalthert
Copy link
Collaborator

@Hasnep interested in testing this feature? Advised: save + commit / backup a copy of the files you apply styler first.

remotes::install_github("r-lib/styler#434")

Then you can proceed as usual after restarting R (Cmd + Shift + F10 in RStudio).

@lorenzwalthert
Copy link
Collaborator

Closed with #434.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants