lorenzwalthert / stylermd

Make markdown or plain text fit 80 characters. Or any limit you want.
21 stars 2 forks source link

`stylermd::tidy_package()` function? #9

Closed IndrajeetPatil closed 6 years ago

IndrajeetPatil commented 6 years ago

Love the styler package and really happy to see its equivalent for md files!

I was wondering if, in the final, CRAN-ready version of the package, is there going to be a stylermd::tidy_package() function (similar to styler:::style_pkg()) that finds all relevant files and styles them, rather than doing this on file-by-file basis?

lorenzwalthert commented 6 years ago

Thanks :-) stylermd will eventually be made available through styler, i.e. depend on the package, but we will probably maintain the stylermd API independently too. In the former case, you should be able to style all .Rmd files with stylermd functionality recurisvely, just as with styler::style_dir() and friends. Time schedule is tbd. Now the latter case: The problem with a tidy_pkg() function is that I am afraid it will style files that the user does not want to to be styled, so it should be limited to files with an extension such as Rmd. because it may result in undesired consequences otherwise and if not tracked with version control, this may be detrimental. What's your take on that?

lorenzwalthert commented 6 years ago

There is a branch of styler that already integrates stylermd.

devtools::install_github("lorenzwalthert/styler@integrate-stylermd")
IndrajeetPatil commented 6 years ago

Thanks.

I have started using this and I can see that outright running styler_md() on the entire package can have unintended and unanticipated effects. So better to err on the side of caution, at least for now.

lorenzwalthert commented 6 years ago

Also see #11.